summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-07-01 00:35:21 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-07-01 00:36:42 +0200
commit8f640e8a1d4a24f845005343a58e1297f51865fd (patch)
treea70e4b90c06f7bc615a7d9ab0aa9c77bd45b77b0 /test/files/pos
parent0a9cea6ea58571deb67d60193d60d12be6bb0233 (diff)
downloadscala-8f640e8a1d4a24f845005343a58e1297f51865fd.tar.gz
scala-8f640e8a1d4a24f845005343a58e1297f51865fd.tar.bz2
scala-8f640e8a1d4a24f845005343a58e1297f51865fd.zip
SI-5932 Tone down non-sensible == warning with refinements.
Errs on the side of avoiding false positives.
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t5932.flags1
-rw-r--r--test/files/pos/t5932.scala15
2 files changed, 16 insertions, 0 deletions
diff --git a/test/files/pos/t5932.flags b/test/files/pos/t5932.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/pos/t5932.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/t5932.scala b/test/files/pos/t5932.scala
new file mode 100644
index 0000000000..d824523d5b
--- /dev/null
+++ b/test/files/pos/t5932.scala
@@ -0,0 +1,15 @@
+class A
+
+case object B extends A
+
+object Test {
+ val x1 = (B: A)
+
+ println(x1 == B) // no warning
+ println(B == x1) // no warning
+
+ val x2 = (B: A with Product)
+
+ println(x2 == B) // no warning
+ println(B == x2) // spurious warning: "always returns false"
+}