aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorliu fengyun <liu@fengy.me>2016-10-14 17:25:49 +0200
committerliu fengyun <liu@fengy.me>2016-10-14 17:46:58 +0200
commiteca3f6997e324559aa499cced51a275fe118051f (patch)
treebb15b1c5f4b180a43e3857ff970912bc57210ad3 /tests/pos
parentcbe2ab26d3b507a33f1b910a803878d78f751f74 (diff)
downloaddotty-eca3f6997e324559aa499cced51a275fe118051f.tar.gz
dotty-eca3f6997e324559aa499cced51a275fe118051f.tar.bz2
dotty-eca3f6997e324559aa499cced51a275fe118051f.zip
add another test for i1540
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/i1540b.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/pos/i1540b.scala b/tests/pos/i1540b.scala
new file mode 100644
index 000000000..2b4c5408e
--- /dev/null
+++ b/tests/pos/i1540b.scala
@@ -0,0 +1,14 @@
+class Casey1[T](val a: T) {
+ def isDefined: Boolean = true
+ def isDefined(x: T): Boolean = ???
+ def get: T = a
+ def get(x: T): String = ???
+}
+object Casey1 { def unapply[T](a: Casey1[T]) = a }
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val c @ Casey1(x) = new Casey1(0)
+ assert(x == c.get)
+ }
+}