File tree 2 files changed +17
-3
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -74,11 +74,13 @@ class CheckRealizable(implicit ctx: Context) {
74
74
else {
75
75
val r =
76
76
if (! sym.isStable) NotStable
77
- else if (! isLateInitialized(sym)) realizability(tp.prefix)
77
+ else if (! isLateInitialized(sym)) Realizable
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
+ r andAlso {
81
+ sym.setFlag(Stable )
82
+ realizability(tp.prefix)
83
+ }
82
84
}
83
85
case _ : SingletonType | NoPrefix =>
84
86
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