diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/bug128_129.check | 7 | ||||
-rw-r--r-- | test/files/neg/bug128_129.scala | 15 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/files/neg/bug128_129.check b/test/files/neg/bug128_129.check new file mode 100644 index 0000000000..d410b57095 --- /dev/null +++ b/test/files/neg/bug128_129.check @@ -0,0 +1,7 @@ +bug128_129.scala:3: variable not allowed under alternative + val x | 1 = 2; // not allowed + ^ +bug128_129.scala:10: recursive patterns not allowed + case PT(a@PT(a)) => // not allowed + ^ +two errors found diff --git a/test/files/neg/bug128_129.scala b/test/files/neg/bug128_129.scala new file mode 100644 index 0000000000..afe4b8f332 --- /dev/null +++ b/test/files/neg/bug128_129.scala @@ -0,0 +1,15 @@ +object Test { + def foo:int = { + val x | 1 = 2; // not allowed + x + } + + class Bar { + case class PT(x: PT) { + def foo(x: Any) = x match { + case PT(a@PT(a)) => // not allowed + } + } + } + +} |