File tree 2 files changed +17
-2
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,11 @@ class CheckRealizable(implicit ctx: Context) {
77
77
else if (! isLateInitialized(sym)) realizability(tp.prefix)
78
78
else if (! sym.isEffectivelyFinal) new NotFinal (sym)
79
79
else realizability(tp.info).mapError(r => new ProblemInUnderlying (tp.info, r))
80
- if (r == Realizable ) sym.setFlag(Stable )
81
- r
80
+ val r1 = if (r == Realizable ) {
81
+ sym.setFlag(Stable )
82
+ realizability(tp.prefix)
83
+ } else r
84
+ r1
82
85
}
83
86
case _ : SingletonType | NoPrefix =>
84
87
Realizable
Original file line number Diff line number Diff line change
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 = ??? // error: `foo` must be final since it's a lazy val
10
+ val x2 : foo.s.type = ??? // error: `foo` must be final since it's a lazy val
11
+ }
12
+
You can’t perform that action at this time.
0 commit comments