Skip to content

Commit 44f9952

Browse files
committed
Add failing test for phantom overload.
1 parent f805aff commit 44f9952

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/neg/phantom-overload.scala

+29
Original file line numberDiff line numberDiff line change
@@ -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+
def foo2(x: A) = ??? // error
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

Comments
 (0)