Skip to content

Commit 7748c5e

Browse files
committed
Another take at the 2.10/2.11 spanning suppressMacroAttachment
It was only working on the former.
1 parent 23f94c2 commit 7748c5e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main/scala/scala/async/internal/AsyncMacro.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,14 @@ private[async] trait AsyncMacro
3737
// Eat it too : (domain specific errors like "unsupported use of await"
3838
//
3939
// TODO roll this idea back into scala/scala
40-
def suppress(globalOrAnalzer: Any) = {
41-
type Suppress = { def suppressMacroExpansion(a: Object): Object }
42-
globalOrAnalzer.asInstanceOf[Suppress].suppressMacroExpansion(macroApplication)
43-
}
40+
41+
import global.Tree
42+
type Suppress = { def suppressMacroExpansion(a: Tree): Tree }
4443
try {
45-
suppress(global) // 2.10.x
44+
global.asInstanceOf[Suppress].suppressMacroExpansion(macroApplication)
4645
} catch {
4746
case _: NoSuchMethodException =>
48-
suppress(global.analyzer) // 2.11
47+
global.analyzer.asInstanceOf[Suppress].suppressMacroExpansion(macroApplication)
4948
}
5049
}
5150

0 commit comments

Comments
 (0)