From eeef2602dc97f84c798713d7a2c924ea2b0d6012 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Sat, 30 Jan 2016 21:53:27 -0800 Subject: SI-8044 Allow binding backquoted varid in patterns Previously, a varid could not be backquoted, so that it was not possible to introduce variables with names such as `type` in a match expression. This commit allows backquoted varids in `case x @ _` and `case x: Int`. In neither position is a stable id accepted, that is, an id with leading uppercase. Therefore, this commit merely relaxes the backquoted varid to be taken as a normal varid in these contexts. --- test/files/neg/t8044.check | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 test/files/neg/t8044.check (limited to 'test/files/neg/t8044.check') 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 -- cgit v1.2.3