From 147e9eaf3814738f339b020e701a160ba2f68b60 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 31 Jan 2012 08:21:34 -0800 Subject: Improved warning for insensible comparisons. Utilize knowledge of case class synthetic equals to rule out some comparisons statically. Closes SI-5426. --- test/files/neg/t5426.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/files/neg/t5426.scala (limited to 'test/files/neg/t5426.scala') diff --git a/test/files/neg/t5426.scala b/test/files/neg/t5426.scala new file mode 100644 index 0000000000..f2fb5cc12c --- /dev/null +++ b/test/files/neg/t5426.scala @@ -0,0 +1,10 @@ +class A { + def f1 = Some(5) == 5 + def f2 = 5 == Some(5) + + val x1 = 5 + val x2 = Some(5) + + (x1 == x2) + (x2 == x1) +} -- cgit v1.2.3