Skip to content

Commit c561b11

Browse files
committed
Fix requireConst code inlining
1 parent d0917c5 commit c561b11

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
648648
arg match
649649
case ConstantValue(_) | Inlined(_, Nil, Typed(ConstantValue(_), _)) => // ok
650650
case _ => report.error(em"expected a constant value but found: $arg", arg.srcPos)
651+
return Literal(Constant(())).withSpan(sourcePos.span)
651652
case (strCtx :: Nil) :: (args :: Nil) :: Nil if inlinedMethod == defn.Compiletime_code =>
652653
return Intrinsics.code(strCtx, args, call.srcPos)
653654
case _ =>

0 commit comments

Comments
 (0)