Skip to content

Commit a7af9d8

Browse files
committed
Add test for structural types
1 parent 062bb98 commit a7af9d8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/init/neg/structural.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import reflect.Selectable.reflectiveSelectable
2+
3+
class Test {
4+
trait A
5+
val m: A { def apply(x: Int): Int } =
6+
new A {
7+
def apply(x: Int): Int =
8+
n + x
9+
}
10+
11+
val n = m(23) // error
12+
}

0 commit comments

Comments
 (0)