summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2015-07-13 10:46:04 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2015-07-13 10:46:04 -0700
commit25d7c879b07fce088fa69f5548efedfeecbf537f (patch)
tree1bbbb6dfced74f1c97d507682e419cc204f3cdf5 /test
parent216e09b3ead43039f2e34a135820ef098c3be74e (diff)
parentfc7cb9a91918cfdf7afe0600a87290ff71f88f12 (diff)
downloadscala-2.12.0-M2.tar.gz
scala-2.12.0-M2.tar.bz2
scala-2.12.0-M2.zip
Merge pull request #4623 from retronym/ticket/9392v2.12.0-M2
SI-9392 Avoid crash in GenBCode for incoherent trees
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/t9392/client_2.scala4
-rw-r--r--test/files/pos/t9392/macro_1.scala16
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/pos/t9392/client_2.scala b/test/files/pos/t9392/client_2.scala
new file mode 100644
index 0000000000..6b706fea12
--- /dev/null
+++ b/test/files/pos/t9392/client_2.scala
@@ -0,0 +1,4 @@
+class Client {
+ Macro()
+}
+
diff --git a/test/files/pos/t9392/macro_1.scala b/test/files/pos/t9392/macro_1.scala
new file mode 100644
index 0000000000..3f67ac17b2
--- /dev/null
+++ b/test/files/pos/t9392/macro_1.scala
@@ -0,0 +1,16 @@
+import language.experimental.macros
+
+
+object Macro {
+
+ import reflect.macros.blackbox.Context
+ def impl(c: Context)(): c.Tree = {
+ import c.universe._
+ val tree = q"""class C; new C"""
+ val tree1 = c.typecheck(tree)
+ val tpe = tree1.tpe
+ val tree2 = c.typecheck(c.untypecheck(tree1))
+ q"""$tree2.asInstanceOf[$tpe]"""
+ }
+ def apply(): Any = macro impl
+}