aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-12-19 14:42:03 +0100
committerFelix Mulder <felix.mulder@gmail.com>2016-12-19 14:42:03 +0100
commit4c32e1b9f585777525a3f9ef5af84c992069bafd (patch)
tree3c5302f6c08b1eaf3a6d1553c6ab5bdb868dd68d /tests/pos
parent59f783a981842ff8aa6299b29083cfaaece82caa (diff)
downloaddotty-4c32e1b9f585777525a3f9ef5af84c992069bafd.tar.gz
dotty-4c32e1b9f585777525a3f9ef5af84c992069bafd.tar.bz2
dotty-4c32e1b9f585777525a3f9ef5af84c992069bafd.zip
Fix #1793: allow multiversal comparisons between Null and X
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/i1793.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/pos/i1793.scala b/tests/pos/i1793.scala
new file mode 100644
index 000000000..fed8a6165
--- /dev/null
+++ b/tests/pos/i1793.scala
@@ -0,0 +1,7 @@
+object Test {
+ import scala.ref.WeakReference
+ def unapply[T <: AnyRef](wr: WeakReference[T]): Option[T] = {
+ val x = wr.underlying.get
+ if (x != null) Some(x) else None
+ }
+}