- 
                Notifications
    
You must be signed in to change notification settings  - Fork 338
 
Open
Description
cf. Peter's old notes
Currently,
outer.fooliterally accessesfooon outer. Instead, it should work more likesuper.foo, i.e., access the lexically closestfoo, not necessarily on the directly enclosing object. Perhapsouter.fooshould also work for method parameters and local properties, e.g.function myFunction(bar) = new { bar = outer.bar }
This is a potentially breaking change in cases like this:
class A {
  foo: String = "baz"
  b: B
}
class B {
  foo: String
}
foo: String = "bar"
a: A = new {
  b {
    foo = outer.foo
  }
}In the current state, a.b.foo is "baz" since outer refers to a. As proposed, if outer.foo refers to the "lexically next outer" foo then a.b.foo is "bar".
Metadata
Metadata
Assignees
Labels
No labels