summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2015-04-01 16:52:54 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2015-04-01 16:52:54 +0200
commit3aea9219c40912f1fe501be67e1a630fd595a35d (patch)
treed6a5634dcaef14f982002fa088df1b5f7ef6b34d /test/files/pos
parent51971954ace37ad6af8bf354d92f6baf51d16324 (diff)
parent32f520f3ed78ecde390dc7b1b48d3130e412a9dc (diff)
downloadscala-3aea9219c40912f1fe501be67e1a630fd595a35d.tar.gz
scala-3aea9219c40912f1fe501be67e1a630fd595a35d.tar.bz2
scala-3aea9219c40912f1fe501be67e1a630fd595a35d.zip
Merge commit '32f520f' into merge/2.11-to-2.12-apr-1
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t8861.flags1
-rw-r--r--test/files/pos/t8861.scala11
-rw-r--r--test/files/pos/t9020.flags1
-rw-r--r--test/files/pos/t9020.scala10
4 files changed, 23 insertions, 0 deletions
diff --git a/test/files/pos/t8861.flags b/test/files/pos/t8861.flags
new file mode 100644
index 0000000000..99a6391058
--- /dev/null
+++ b/test/files/pos/t8861.flags
@@ -0,0 +1 @@
+-Xlint:infer-any -Xfatal-warnings
diff --git a/test/files/pos/t8861.scala b/test/files/pos/t8861.scala
new file mode 100644
index 0000000000..816d15700e
--- /dev/null
+++ b/test/files/pos/t8861.scala
@@ -0,0 +1,11 @@
+
+trait Test {
+ type R = PartialFunction[Any, Unit]
+
+ val x: R = { case "" => }
+ val y: R = { case "" => }
+
+ val z: R = x orElse y
+ val zz = x orElse y
+}
+
diff --git a/test/files/pos/t9020.flags b/test/files/pos/t9020.flags
new file mode 100644
index 0000000000..efb2dd3e6f
--- /dev/null
+++ b/test/files/pos/t9020.flags
@@ -0,0 +1 @@
+-Ywarn-value-discard -Xfatal-warnings
diff --git a/test/files/pos/t9020.scala b/test/files/pos/t9020.scala
new file mode 100644
index 0000000000..16e31e2572
--- /dev/null
+++ b/test/files/pos/t9020.scala
@@ -0,0 +1,10 @@
+trait ValueDiscard[@specialized U] {
+ def u: U
+}
+/* Was:
+scalac-hash v2.11.5 -Ywarn-value-discard test/files/pos/t9020.scala
+test/files/pos/t9020.scala:2: warning: discarded non-Unit value
+ def u: U
+ ^
+one warning found
+*/