diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-12-13 02:20:47 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-12-13 10:48:22 +0100 |
commit | 098e8a084adbebca1f2e57e1aacbf6d9a3a87e7d (patch) | |
tree | 45d9b5fa5d768402e7eb51ae6a755dea2cb89e6f /test/files/pos/attachments-typed-ident/Impls_1.scala | |
parent | a6f10cf7f4245f2dfcf2fef5fab5255b6fca119f (diff) | |
download | scala-098e8a084adbebca1f2e57e1aacbf6d9a3a87e7d.tar.gz scala-098e8a084adbebca1f2e57e1aacbf6d9a3a87e7d.tar.bz2 scala-098e8a084adbebca1f2e57e1aacbf6d9a3a87e7d.zip |
typedIdent no longer destroys attachments
When transforming Idents to qualified Selects, typedIdent used to forget
about carrying original attachments to the resulting tree. Not anymore.
Diffstat (limited to 'test/files/pos/attachments-typed-ident/Impls_1.scala')
-rw-r--r-- | test/files/pos/attachments-typed-ident/Impls_1.scala | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/pos/attachments-typed-ident/Impls_1.scala b/test/files/pos/attachments-typed-ident/Impls_1.scala new file mode 100644 index 0000000000..cc40893a93 --- /dev/null +++ b/test/files/pos/attachments-typed-ident/Impls_1.scala @@ -0,0 +1,17 @@ +import scala.reflect.macros.Context +import language.experimental.macros + +object MyAttachment + +object Macros { + def impl(c: Context) = { + import c.universe._ + val ident = Ident(newTermName("bar")) updateAttachment MyAttachment + assert(ident.attachments.get[MyAttachment.type].isDefined, ident.attachments) + val typed = c.typeCheck(ident) + assert(typed.attachments.get[MyAttachment.type].isDefined, typed.attachments) + c.Expr[Int](typed) + } + + def foo = macro impl +}
\ No newline at end of file |