<< §1.2.2.(c) Immutable anchor | ↑ Table of Contents ↑ | §1.2.2.(e) Conformance >> |
§1.2.2.(d) Implicit type anchors
The current team instance can be used as a default anchor for role types:
- In non-static team level methods role types are by default interpreted as anchored to
this
(referring to the team instance). I.e., the following two declarations express the same:public RoleX getRoleX (RoleY r) { stmts } public RoleX<@this> getRoleX (RoleY<@this> r) { stmts }
- In analogy, role methods use the enclosing team instance as the default anchor for any role types.
Note, that this
and Outer.this
are always
final
.
The compiler uses the pseudo identifier tthis
to denote
such implicit type anchors in error messages.
<< §1.2.2.(c) Immutable anchor | ↑ Table of Contents ↑ | §1.2.2.(e) Conformance >> |