File tree Expand file tree Collapse file tree 4 files changed +36
-4
lines changed
src/dotty/tools/dotc/core Expand file tree Collapse file tree 4 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -525,7 +525,9 @@ object SymDenotations {
525
525
/** Is this a denotation of a realizable term (or an arbitrary type)? */
526
526
final def isRealizable (implicit ctx : Context ) =
527
527
is(Stable ) || isType || {
528
- val isRealizable = ! is(Lazy , butNot = Module ) || ctx.realizability(info) == TypeOps .Realizable
528
+ val isRealizable =
529
+ ! is(Lazy , butNot = Module ) ||
530
+ is(Final ) && ctx.realizability(info) == TypeOps .Realizable
529
531
isRealizable && { setFlag(Stable ); true }
530
532
}
531
533
Original file line number Diff line number Diff line change @@ -156,7 +156,8 @@ class tests extends CompilerTest {
156
156
@ Test def neg_i705 = compileFile(negDir, " i705-inner-value-class" , xerrors = 7 )
157
157
@ Test def neg_i866 = compileFile(negDir, " i866" , xerrors = 2 )
158
158
@ Test def neg_i974 = compileFile(negDir, " i974" , xerrors = 2 )
159
- @ Test def neg_i1050 = compileFile(negDir, " i1050" , xerrors = 3 )
159
+ @ Test def neg_i1050 = compileFile(negDir, " i1050" , xerrors = 5 )
160
+ @ Test def neg_i1050a = compileFile(negDir, " i1050a" , xerrors = 2 )
160
161
@ Test def neg_moduleSubtyping = compileFile(negDir, " moduleSubtyping" , xerrors = 4 )
161
162
@ Test def neg_escapingRefs = compileFile(negDir, " escapingRefs" , xerrors = 2 )
162
163
@ Test def neg_instantiateAbstract = compileFile(negDir, " instantiateAbstract" , xerrors = 8 )
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ object Tiark1 {
39
39
trait A { type L <: Nothing }
40
40
trait B { type L >: Any }
41
41
trait U {
42
- val p : B
42
+ lazy val p : B
43
43
def brand (x : Any ): p.L = x // error: not final
44
44
}
45
45
trait V extends U {
@@ -53,7 +53,7 @@ object Tiark2 {
53
53
trait B { type L >: Any }
54
54
trait U {
55
55
type X <: B
56
- val p : X
56
+ lazy val p : X
57
57
def brand (x : Any ): p.L = x // error: not final
58
58
}
59
59
trait V extends U {
Original file line number Diff line number Diff line change
1
+ object Tiark1 {
2
+ trait A { type L <: Nothing }
3
+ trait B { type L >: Any }
4
+ trait U {
5
+ val p : B
6
+ def brand (x : Any ): p.L = x // error: not final
7
+ }
8
+ trait V extends U {
9
+ lazy val p : A & B = ???
10
+ }
11
+ val v = new V {}
12
+ v.brand(" boom!" )
13
+ }
14
+ object Tiark2 {
15
+ trait A { type L <: Nothing }
16
+ trait B { type L >: Any }
17
+ trait U {
18
+ type X <: B
19
+ val p : X
20
+ def brand (x : Any ): p.L = x // error: not final
21
+ }
22
+ trait V extends U {
23
+ type X = B & A
24
+ lazy val p : X = ???
25
+ }
26
+ val v = new V {}
27
+ v.brand(" boom!" ): Nothing
28
+ }
29
+
You can’t perform that action at this time.
0 commit comments