Using Class Scope Resolution operator within in-line Constraint

In reply to MICRO_91:

Yes, it works in this. I can think of a contrived example where local:: is still needed. For example, when the classes trans and seq are defined in different packages as extensions to different classes with the same base class name.

The search rules are quite simple: the in-line constraint searches identifiers in the object being randomized, if not found, it searches from the scope of the call to randomize.

In your example the reference to t.addr is searching for t in the object being randomized and does not find it. It then searches from the scope of the body() task and finds t a member of the seq class. Then it resolves addr as a member of t. You could have just written addr == seq::addr.