summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-11-12 00:07:37 +0000
committerPaul Phillips <paulp@improving.org>2010-11-12 00:07:37 +0000
commit91eff8e6d903a9eab2bc83c120774d623df5ad7d (patch)
tree23b15f42d230452d5f0ac0b7ff6ee9f96766a3d5 /test
parent46a921df8152d2535cca577132a2fe323a57ca88 (diff)
downloadscala-91eff8e6d903a9eab2bc83c120774d623df5ad7d.tar.gz
scala-91eff8e6d903a9eab2bc83c120774d623df5ad7d.tar.bz2
scala-91eff8e6d903a9eab2bc83c120774d623df5ad7d.zip
Half of an implementation of sealedness for jav...
Half of an implementation of sealedness for java enums. Since it's only half it's behind -Xexperimental, but it works like a charm for the half where it works (that being compiling against bytecode.) Need input on how to approach the source half. References ticket #2442. Review by moors.
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/sealed-java-enums.check8
-rw-r--r--test/files/neg/sealed-java-enums.flags1
-rw-r--r--test/files/neg/sealed-java-enums.scala10
3 files changed, 19 insertions, 0 deletions
diff --git a/test/files/neg/sealed-java-enums.check b/test/files/neg/sealed-java-enums.check
new file mode 100644
index 0000000000..9a4bd4241e
--- /dev/null
+++ b/test/files/neg/sealed-java-enums.check
@@ -0,0 +1,8 @@
+sealed-java-enums.scala:5: error: match is not exhaustive!
+missing combination BLOCKED
+missing combination TERMINATED
+missing combination TIMED_WAITING
+
+ def f(state: State) = state match {
+ ^
+one error found
diff --git a/test/files/neg/sealed-java-enums.flags b/test/files/neg/sealed-java-enums.flags
new file mode 100644
index 0000000000..e709c65918
--- /dev/null
+++ b/test/files/neg/sealed-java-enums.flags
@@ -0,0 +1 @@
+-Xexperimental -Xfatal-warnings
diff --git a/test/files/neg/sealed-java-enums.scala b/test/files/neg/sealed-java-enums.scala
new file mode 100644
index 0000000000..2daf93f308
--- /dev/null
+++ b/test/files/neg/sealed-java-enums.scala
@@ -0,0 +1,10 @@
+import java.lang.Thread.State
+import java.lang.Thread.State._
+
+object Test {
+ def f(state: State) = state match {
+ case NEW | WAITING => true
+ case RUNNABLE => false
+ // and I forget the rest
+ }
+}