Skip to content

Commit 3c52af8

Browse files
committed
Add neg tests for clases.
1 parent 1979904 commit 3c52af8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/neg/phantomInstanceOf2.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import dotty.phantom.PhantomAny
22
import dotty.phantom.PhantomNothing
33
import dotty.phantom.phantasmic
44

5+
class Blinky extends PhantomAny
6+
57
class phantomInstanceOf2 {
6-
phantasmic[PhantomAny].asInstanceOf[Any] // error
7-
phantasmic[PhantomAny].asInstanceOf[Nothing] // error
8-
phantasmic[PhantomNothing].asInstanceOf[Any] // error
9-
phantasmic[PhantomNothing].asInstanceOf[Nothing] // error
8+
new Blinky().asInstanceOf[Any] // error
9+
new Blinky().asInstanceOf[Nothing] // error
10+
new Blinky().asInstanceOf[PhantomAny] // error
1011
}

0 commit comments

Comments
 (0)