Skip to content

Commit 673392b

Browse files
committed
add another test for i1540
1 parent cbe2ab2 commit 673392b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/pos/i1540b.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Casey1[T](val a: T) {
2+
def isDefined: Boolean = true
3+
def isDefined(x: T): Boolean = ???
4+
def get: T = a
5+
def get(x: T): String = ???
6+
}
7+
object Casey1 { def unapply[T](a: Casey1[T]) = a }
8+
9+
object Test {
10+
def main(args: Array[String]): Unit = {
11+
val c @ Casey1(x) = new Casey1(0)
12+
assert(x == c.get)
13+
}
14+
}

0 commit comments

Comments
 (0)