diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-11-07 11:26:03 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-11-07 21:41:42 +1000 |
commit | b8f7fbee940856173dd19afddcd689495313c4cf (patch) | |
tree | a066ac526d80c7141f3e0e89e3ec651b415347e5 /test | |
parent | ced9e167d9d2c9016e76b6db94ceea7335d37bf2 (diff) | |
download | scala-b8f7fbee940856173dd19afddcd689495313c4cf.tar.gz scala-b8f7fbee940856173dd19afddcd689495313c4cf.tar.bz2 scala-b8f7fbee940856173dd19afddcd689495313c4cf.zip |
SI-8965 Account for corner case in "unrelated types" warning
It's okay for the two types to LUB to something above `Object`
if they both individially were its supertype.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t8965.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t8965.scala | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/test/files/pos/t8965.flags b/test/files/pos/t8965.flags new file mode 100644 index 0000000000..85d8eb2ba2 --- /dev/null +++ b/test/files/pos/t8965.flags @@ -0,0 +1 @@ +-Xfatal-warnings diff --git a/test/files/pos/t8965.scala b/test/files/pos/t8965.scala new file mode 100644 index 0000000000..4f39330f4e --- /dev/null +++ b/test/files/pos/t8965.scala @@ -0,0 +1,7 @@ +class A { + def f(x: Any with AnyRef, y: Any with AnyRef) = x eq y + // a.scala:2: warning: Any and Any are unrelated: they will most likely never compare equal + // def f(x: Any with AnyRef, y: Any with AnyRef) = x eq y + // ^ + // one warning found +} |