Skip to content

Commit 9dc9895

Browse files
committed
Fix a NPE in the presentation compiler
We were using a TypingTransformer and we called `atOwner` before we had called `transform`. This meant that `currTree` was null, which was observed when that was passed to `Context#make`. IDE ticket: https://scala-ide-portfolio.assembla.com/spaces/scala-ide/tickets/1001971#/activity/ticket: Stack trace: exception during macro expansion: java.lang.NullPointerException at scala.tools.nsc.interactive.ContextTrees$class.addContext(ContextTrees.scala:78) at scala.tools.nsc.interactive.Global.addContext(Global.scala:28) at scala.tools.nsc.interactive.Global.registerContext(Global.scala:268) at scala.tools.nsc.typechecker.Contexts$Context.make(Contexts.scala:295) at scala.tools.nsc.typechecker.Contexts$Context.make0(Contexts.scala:320) at scala.tools.nsc.typechecker.Contexts$Context.make(Contexts.scala:327) at scala.tools.nsc.typechecker.Typers$Typer.atOwner(Typers.scala:5662) at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:33) at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:28) at scala.async.internal.AsyncTransform$class.fixup$1(AsyncTransform.scala:191)
1 parent c79ecac commit 9dc9895

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/scala/scala/async/internal/TransformUtils.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ private[async] trait TransformUtils {
203203

204204
abstract class MacroTypingTransformer extends TypingTransformer(callSiteTyper.context.unit) {
205205
currentOwner = callSiteTyper.context.owner
206+
curTree = EmptyTree
206207

207208
def currOwner: Symbol = currentOwner
208209

0 commit comments

Comments
 (0)