Skip to content

Commit 5beb624

Browse files
committed
Add a val in Scala 2 macro bundles
1 parent e4bb383 commit 5beb624

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3574,7 +3574,9 @@ class Typer extends Namer
35743574
case Ident(name) => untpd.Ident(name.toTypeName).withSpan(tree.span)
35753575
case Select(qual, name) => untpd.Select(qual, name.toTypeName).withSpan(tree.span)
35763576
val bundle = untpd.Apply(untpd.Select(untpd.New(ref), nme.CONSTRUCTOR), untpd.Literal(Constant(null))).withSpan(call.span)
3577-
typedExpr(bundle, defn.AnyType)
3577+
val bundle1 = typedExpr(bundle, defn.AnyType)
3578+
val bundleVal = SyntheticValDef(NameKinds.UniqueName.fresh("bundle".toTermName), bundle1)
3579+
tpd.Block(List(bundleVal), tpd.ref(bundleVal.symbol))
35783580
}
35793581
}
35803582
if ctx.phase.isTyper then

0 commit comments

Comments
 (0)