From b8f7fbee940856173dd19afddcd689495313c4cf Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 7 Nov 2014 11:26:03 +1000 Subject: 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. --- test/files/pos/t8965.scala | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 test/files/pos/t8965.scala (limited to 'test/files/pos/t8965.scala') 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 +} -- cgit v1.2.3