| << §9.2.1 Parameter substitution | ↑ Table of Contents ↑ |
§9.2.2 Type conformance
Two value dependent types (anchored types) are considered conform only if the anchors of both types refer to the same object(s). The compiler must be able to statically analyze this anchor identity.
(a) Substitutions for type anchors
Only two substitutions are considered for determining anchor identity:
- If a method signature uses
thisas the anchor of any of its types, type checking an application of this method performs the following substitutions:
A simplethisexpression is substituted by the actual call target of the method application.
A qualifiedOuter.thisexpression is substituted by the corresponding enclosing instance of the call target. - Assignments from a
finalidentifier to anotherfinalidentifier are transitively followed, i.e., ift1, t2are final, after an assignmentt1=t2the typesC<@t1>andC<@t2>are considered identical. OtherwiseC<@t1>andC<@t2>are incommensurable.
Attaching an actual parameter to a formal parameter in a method call is also considered as an assignment with respect to this rule.
| << §9.2.1 Parameter substitution | ↑ Table of Contents ↑ |