diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-07-13 10:46:04 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-07-13 10:46:04 -0700 |
commit | 25d7c879b07fce088fa69f5548efedfeecbf537f (patch) | |
tree | 1bbbb6dfced74f1c97d507682e419cc204f3cdf5 /test/files | |
parent | 216e09b3ead43039f2e34a135820ef098c3be74e (diff) | |
parent | fc7cb9a91918cfdf7afe0600a87290ff71f88f12 (diff) | |
download | scala-25d7c879b07fce088fa69f5548efedfeecbf537f.tar.gz scala-25d7c879b07fce088fa69f5548efedfeecbf537f.tar.bz2 scala-25d7c879b07fce088fa69f5548efedfeecbf537f.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/files')
-rw-r--r-- | test/files/pos/t9392/client_2.scala | 4 | ||||
-rw-r--r-- | test/files/pos/t9392/macro_1.scala | 16 |
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 +} |