diff options
author | liu fengyun <liu@fengy.me> | 2016-10-14 12:01:13 +0200 |
---|---|---|
committer | liu fengyun <liu@fengy.me> | 2016-10-14 17:11:42 +0200 |
commit | cbe2ab26d3b507a33f1b910a803878d78f751f74 (patch) | |
tree | 350e2fa199ebda8c2b94a22ec2b9d20aa9704c91 /tests/pos/i1540.scala | |
parent | 8bfaadaae141e83db7f515b042fcee26ed0e54fd (diff) | |
download | dotty-cbe2ab26d3b507a33f1b910a803878d78f751f74.tar.gz dotty-cbe2ab26d3b507a33f1b910a803878d78f751f74.tar.bz2 dotty-cbe2ab26d3b507a33f1b910a803878d78f751f74.zip |
fix #1540: overloaded get and isDefined in option-less patmat
Diffstat (limited to 'tests/pos/i1540.scala')
-rw-r--r-- | tests/pos/i1540.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/pos/i1540.scala b/tests/pos/i1540.scala new file mode 100644 index 000000000..7aa24f459 --- /dev/null +++ b/tests/pos/i1540.scala @@ -0,0 +1,14 @@ +class Casey1(val a: Int) { + def isDefined: Boolean = true + def isDefined(x: Int): Boolean = ??? + def get: Int = a + def get(x: Int): String = ??? +} +object Casey1 { def unapply(a: Casey1) = a } + +object Test { + def main(args: Array[String]): Unit = { + val c @ Casey1(x) = new Casey1(0) + assert(x == c.get) + } +} |