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
Copy file name to clipboardExpand all lines: tests/run/phantom.scala
+54-44
Original file line number
Diff line number
Diff line change
@@ -8,104 +8,114 @@ object Test {
8
8
importdotty.phantom.PhantomNothing
9
9
importPhantoms._
10
10
11
+
traitPhantoms {
12
+
typeClyde>:Pinky<:Inky
13
+
}
14
+
15
+
objectPhantomsextendsPhantoms {
16
+
traitBlinkyextendsPhantomAny
17
+
abstractclassInkyextendsBlinky
18
+
classPinkyextendsInky
19
+
objectMoroiextendsPinky
20
+
}
21
+
11
22
defmain(args: Array[String]):Unit= {
12
-
fun1(newBlinky {})
13
-
fun1(newInky {})
23
+
classBlinkyImplextendsBlinky
24
+
classInkyImplextendsInky
25
+
26
+
fun1(newBlinkyImpl)
27
+
fun1(newInkyImpl)
14
28
fun1(newPinky)
29
+
fun1(Moroi)
15
30
16
-
fun3(newBlinky {}, newPinky)
17
-
fun3(newInky {}, newPinky)
18
-
fun3(newPinky, newPinky)
31
+
fun3(newBlinkyImpl, newPinky)
32
+
fun3(newInkyImpl, newPinky)
33
+
fun3(newPinky, Moroi)
19
34
20
-
fun4(3, 4)(newBlinky {}, newPinky)
21
-
fun4(5, 6)(newInky {}, newPinky)
22
-
fun4(7, 8)(newPinky, newPinky)
35
+
fun4(3, 4)(newBlinkyImpl, newPinky)
36
+
fun4(5, 6)(newInkyImpl, newPinky)
37
+
fun4(7, 8)(newPinky, Moroi)
23
38
24
-
fun5(newBlinky {}, newPinky)(15, 16)
25
-
fun5(newInky {}, newPinky)(17, 18)
26
-
fun5(newPinky, newPinky)(19, 20)
39
+
fun5(newBlinkyImpl, newPinky)(15, 16)
40
+
fun5(newInkyImpl, newPinky)(17, 18)
41
+
fun5(newPinky, Moroi)(19, 20)
27
42
28
43
polyfun1()
29
44
30
45
polyfun2(newBoo6().boo1)
31
46
polyfun2(newBoo6().boo2)
32
-
println("polyfun2") // polyfun2(new Blinky {}) // FIXME: error: Type argument (Object & Test.Phantoms.Blinky)' does not conform to lower bound PhantomNothing
0 commit comments