You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1 class Hello {
2 class Foo {
3 class Bar
4 final lazy val s: Bar = ???
5 }
6
7 lazy val foo: Foo = ???
8
9 val x: foo.s.type = ???
10 val x2: foo.s.type = ???
11 }
Expected: both line 9 and 10 produce an error.
Actual: only line 10 produces an error:
10 | val x2: foo.s.type = ???
| ^
| Hello.this.foo.Bar(Hello.this.foo.s) is not a legal path
| since it refers to nonfinal lazy value foo
Expected: both line 9 and 10 produce an error.
Actual: only line 10 produces an error:
The reason is the cached and uncached cases are handled differently in https://github.com/lampepfl/dotty/blob/master/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala#L80
The uncached case doesn't check the prefix (hence why only the second time we try to use the same invalid path errors out).
The text was updated successfully, but these errors were encountered: