diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2016-05-24 10:51:20 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan@lightbend.com> | 2016-05-24 10:51:20 -0700 |
commit | 808f3d071e97aa23b797f2c0616c207ff1f20229 (patch) | |
tree | 1aee8d0752d915f7295e29fd7778a9a82a1fa4d5 /test/files/neg | |
parent | 4d28084e36e8c4072ffcd3cab35b7f22983bea4a (diff) | |
parent | 1e565d879360709758950332c19a77fffee073d1 (diff) | |
download | scala-808f3d071e97aa23b797f2c0616c207ff1f20229.tar.gz scala-808f3d071e97aa23b797f2c0616c207ff1f20229.tar.bz2 scala-808f3d071e97aa23b797f2c0616c207ff1f20229.zip |
Merge pull request #4935 from som-snytt/issue/8044-tickvar
SI-8044 Allow binding backquoted varid in patterns
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t8044-b.check | 4 | ||||
-rw-r--r-- | test/files/neg/t8044-b.scala | 4 | ||||
-rw-r--r-- | test/files/neg/t8044.check | 4 | ||||
-rw-r--r-- | test/files/neg/t8044.scala | 4 |
4 files changed, 16 insertions, 0 deletions
diff --git a/test/files/neg/t8044-b.check b/test/files/neg/t8044-b.check new file mode 100644 index 0000000000..4a93e9a772 --- /dev/null +++ b/test/files/neg/t8044-b.check @@ -0,0 +1,4 @@ +t8044-b.scala:3: error: Pattern variables must start with a lower-case letter. (SLS 8.1.1.) + def g = 42 match { case `Oops` : Int => } // must be varish + ^ +one error found diff --git a/test/files/neg/t8044-b.scala b/test/files/neg/t8044-b.scala new file mode 100644 index 0000000000..fb2e921ac9 --- /dev/null +++ b/test/files/neg/t8044-b.scala @@ -0,0 +1,4 @@ + +trait T { + def g = 42 match { case `Oops` : Int => } // must be varish +} diff --git a/test/files/neg/t8044.check b/test/files/neg/t8044.check new file mode 100644 index 0000000000..678bf8c700 --- /dev/null +++ b/test/files/neg/t8044.check @@ -0,0 +1,4 @@ +t8044.scala:3: error: not found: value _ + def f = 42 match { case `_` : Int => `_` } // doesn't leak quoted underscore + ^ +one error found diff --git a/test/files/neg/t8044.scala b/test/files/neg/t8044.scala new file mode 100644 index 0000000000..930c30c5a5 --- /dev/null +++ b/test/files/neg/t8044.scala @@ -0,0 +1,4 @@ + +trait T { + def f = 42 match { case `_` : Int => `_` } // doesn't leak quoted underscore +} |