diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-12-19 14:42:03 +0100 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-12-19 14:42:03 +0100 |
commit | 4c32e1b9f585777525a3f9ef5af84c992069bafd (patch) | |
tree | 3c5302f6c08b1eaf3a6d1553c6ab5bdb868dd68d /tests/pos | |
parent | 59f783a981842ff8aa6299b29083cfaaece82caa (diff) | |
download | dotty-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.scala | 7 |
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 + } +} |