We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f805aff commit 44f9952Copy full SHA for 44f9952
tests/neg/phantom-overload.scala
@@ -0,0 +1,29 @@
1
+
2
+class phantomOverload {
3
+ import Boo._
4
+ import Boo2._
5
6
+ def foo1(): A = nothing // error
7
+ def foo1(): B = nothing // error
8
+ def foo1(): C = nothing // error
9
+ def foo1(): N = nothing // error
10
11
+ def foo2(x: A) = ??? // error
12
13
+ def foo2(x: B) = ??? // error
14
+ def foo2(x: C) = ??? // error
15
+ def foo2(x: N) = ??? // error
16
17
+}
18
19
+object Boo extends Phantom {
20
+ type A <: this.Any
21
+ type B <: this.Any
22
+ type N = this.Nothing
23
+ def nothing = assume[this.Nothing]
24
25
26
+object Boo2 extends Phantom {
27
+ type C <: this.Any
28
+ def nothing2 = assume[this.Nothing]
29
0 commit comments