Resolves to in clauses
resolves to
does not reuse thein
clauses from therefers to
on the same term. (I expected it to reuse the same tasks for resolving rather than creating a new computation.)Since
resolves to
does not reuse thein
clauses from therefers to
one needs anin
clause for correctly resolving references in something else than the current scope.Example
Example code:
system debug class A { attributes b : B methods m1 { b . updateA (a? = 3) } } class B { attributes a : INT c : A methods m0 { updateA (a? = 3) } m2 { c. b . updateA (a? = 3) } updateA { a' = a + a? } }
a?
inm1 { b . updateA (a? = 3) }
is now resolved in scopes[/ Class:"A"#0 / System:"debug"#0 /, / System:"debug"#0 /, / /]
, while it should be resolved inClass:B
.Nabl spec:
Submitted by Daco Harkes on 14 January 2015 at 16:19MethodReference(PathStart(m-ref, prime), params): implicitly defines MethodReference MethodReference() of type m-def in params where m-ref resolves to Method m-def MethodReference(Path(path-start, PathComponent(m-ref, prime)), params): implicitly defines MethodReference MethodReference() of type m-def of type2 path-start-ty in params where m-ref resolves to Method m-def //in Class path-start-ty and path-start has type path-start-ty Param(v): refers to Variable v in Method m where MethodReference() resolves to MethodReference m-ref and m-ref has type m
Log in to post comments