aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/neg/i1779.scala13
-rw-r--r--tests/run/i1779.check1
-rw-r--r--tests/run/i1779.scala13
3 files changed, 27 insertions, 0 deletions
diff --git a/tests/neg/i1779.scala b/tests/neg/i1779.scala
new file mode 100644
index 000000000..92100fa06
--- /dev/null
+++ b/tests/neg/i1779.scala
@@ -0,0 +1,13 @@
+object Test {
+ implicit class Foo(sc: StringContext) {
+ object q {
+ def apply(arg: Any*): Int = 3
+ }
+ }
+
+ def f = {
+ val _parent = 3
+ q"val hello = $_parent"
+ q"class $_" // error // error
+ }
+}
diff --git a/tests/run/i1779.check b/tests/run/i1779.check
new file mode 100644
index 000000000..4ef6e900e
--- /dev/null
+++ b/tests/run/i1779.check
@@ -0,0 +1 @@
+ extends
diff --git a/tests/run/i1779.scala b/tests/run/i1779.scala
new file mode 100644
index 000000000..e81bc97b6
--- /dev/null
+++ b/tests/run/i1779.scala
@@ -0,0 +1,13 @@
+object Test {
+ implicit class Foo(sc: StringContext) {
+ object q {
+ def unapply(arg: Any): Option[(Any, Any)] =
+ Some((sc.parts(0), sc.parts(1)))
+ }
+ }
+
+ def main(args: Array[String]): Unit = {
+ val q"class $_ extends $_parent" = new Object
+ println(_parent)
+ }
+}