summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@epfl.ch>2010-11-02 00:14:43 +0000
committerHubert Plociniczak <hubert.plociniczak@epfl.ch>2010-11-02 00:14:43 +0000
commitf4e000f7f08086727cec4c810873379de8ab2624 (patch)
tree13b34595dc6162b91a19754446b201577866326e /test
parent278ec47fb14f58b82e78f4c77b49d35eec122b92 (diff)
downloadscala-f4e000f7f08086727cec4c810873379de8ab2624.tar.gz
scala-f4e000f7f08086727cec4c810873379de8ab2624.tar.bz2
scala-f4e000f7f08086727cec4c810873379de8ab2624.zip
Closes #3816. Review by moors.
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t3816.check7
-rw-r--r--test/files/neg/t3816.scala42
2 files changed, 49 insertions, 0 deletions
diff --git a/test/files/neg/t3816.check b/test/files/neg/t3816.check
new file mode 100644
index 0000000000..3658e76b64
--- /dev/null
+++ b/test/files/neg/t3816.check
@@ -0,0 +1,7 @@
+t3816.scala:30: error: stable identifier required, but syncID found.
+ case Some( `syncID` ) =>
+ ^
+t3816.scala:38: error: stable identifier required, but Test.this.foo found.
+ case Some( `foo` ) =>
+ ^
+two errors found
diff --git a/test/files/neg/t3816.scala b/test/files/neg/t3816.scala
new file mode 100644
index 0000000000..31b0825f1d
--- /dev/null
+++ b/test/files/neg/t3816.scala
@@ -0,0 +1,42 @@
+class B {
+ def ::(a: List[Int]) {
+ a match {
+ case x::xs =>
+ case _ =>
+ }
+ }
+}
+
+object Test {
+ def testSuccess1( x: Any ) = {
+ val stable = 2
+ x match {
+ case Some( `stable` ) =>
+ case _ =>
+ }
+ }
+
+ val bar = 3
+ def testSuccess2( x: Any ) = {
+ x match {
+ case Some( `bar` ) =>
+ case _ =>
+ }
+ }
+
+ def testFail1( x: Any ) = {
+ var syncID = 0
+ x match {
+ case Some( `syncID` ) =>
+ case _ =>
+ }
+ }
+
+ var foo = 0
+ def testFail2( x: Any ) = {
+ x match {
+ case Some( `foo` ) =>
+ case _ =>
+ }
+ }
+}