diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-11-20 23:00:16 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-11-20 23:00:16 +0100 |
commit | 7748c5e6eab31328da786b57a875d887d69ec50a (patch) | |
tree | b150f7cbe16ab1ec005184c3c0d455d6cdd65431 /src/main/scala | |
parent | 23f94c257c3d5e8ad345cdcc7c9dae8b214d7c51 (diff) | |
download | scala-async-7748c5e6eab31328da786b57a875d887d69ec50a.tar.gz scala-async-7748c5e6eab31328da786b57a875d887d69ec50a.tar.bz2 scala-async-7748c5e6eab31328da786b57a875d887d69ec50a.zip |
Another take at the 2.10/2.11 spanning suppressMacroAttachment
It was only working on the former.
Diffstat (limited to 'src/main/scala')
-rw-r--r-- | src/main/scala/scala/async/internal/AsyncMacro.scala | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/scala/scala/async/internal/AsyncMacro.scala b/src/main/scala/scala/async/internal/AsyncMacro.scala index d030367..79f544c 100644 --- a/src/main/scala/scala/async/internal/AsyncMacro.scala +++ b/src/main/scala/scala/async/internal/AsyncMacro.scala @@ -37,15 +37,14 @@ private[async] trait AsyncMacro // Eat it too : (domain specific errors like "unsupported use of await" // // TODO roll this idea back into scala/scala - def suppress(globalOrAnalzer: Any) = { - type Suppress = { def suppressMacroExpansion(a: Object): Object } - globalOrAnalzer.asInstanceOf[Suppress].suppressMacroExpansion(macroApplication) - } + + import global.Tree + type Suppress = { def suppressMacroExpansion(a: Tree): Tree } try { - suppress(global) // 2.10.x + global.asInstanceOf[Suppress].suppressMacroExpansion(macroApplication) } catch { case _: NoSuchMethodException => - suppress(global.analyzer) // 2.11 + global.analyzer.asInstanceOf[Suppress].suppressMacroExpansion(macroApplication) } } |