Skip to content

Commit bcd3796

Browse files
committed
Add test
1 parent 01260f4 commit bcd3796

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/neg/module-class-name.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
object Test {
2+
class C
3+
object C
4+
5+
def f[T](x: T): T = x
6+
7+
val x: C = C // error: Found: Test.C.type
8+
9+
val y: C = f(C) // error: Found: Test.C.type
10+
11+
def z = f(C)
12+
val z1: C = z // error: Found: object Test.C
13+
val z2: Int = z // error: Found: object Test.C
14+
15+
C.foo // error: value foo is not a member of object Test.C
16+
}

0 commit comments

Comments
 (0)