@@ -705,41 +705,6 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
705
705
case _ =>
706
706
}
707
707
708
- def issueCode ()(using Context ): Literal = {
709
- def decompose (arg : Tree ): String = arg match {
710
- case Typed (arg, _) => decompose(arg)
711
- case SeqLiteral (elems, _) => elems.map(decompose).mkString(" , " )
712
- case Block (Nil , expr) => decompose(expr)
713
- case Inlined (_, Nil , expr) => decompose(expr)
714
- case arg =>
715
- arg.tpe.widenTermRefExpr match {
716
- case ConstantType (Constant (c)) => c.toString
717
- case _ => arg.show
718
- }
719
- }
720
-
721
- def malformedString (): String = {
722
- ctx.error(" Malformed part `code` string interpolator" , call.sourcePos)
723
- " "
724
- }
725
-
726
- callValueArgss match {
727
- case List (List (Apply (_,List (Typed (SeqLiteral (Literal (headConst) :: parts,_),_)))), List (Typed (SeqLiteral (interpolatedParts,_),_)))
728
- if parts.size == interpolatedParts.size =>
729
- val constantParts = parts.map {
730
- case Literal (const) => const.stringValue
731
- case _ => malformedString()
732
- }
733
- val decomposedInterpolations = interpolatedParts.map(decompose)
734
- val constantString = decomposedInterpolations.zip(constantParts)
735
- .foldLeft(headConst.stringValue) { case (acc, (p1, p2)) => acc + p1 + p2 }
736
-
737
- Literal (Constant (constantString)).withSpan(call.span)
738
- case _ =>
739
- Literal (Constant (malformedString()))
740
- }
741
- }
742
-
743
708
trace(i " inlining $call" , inlining, show = true ) {
744
709
745
710
// The normalized bindings collected in `bindingsBuf`
@@ -763,12 +728,9 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
763
728
764
729
if (inlinedMethod == defn.Compiletime_error ) issueError()
765
730
766
- if (inlinedMethod == defn.Compiletime_code )
767
- issueCode()(using ctx.fresh.setSetting(ctx.settings.color, " never" ))
768
- else
769
- // Take care that only argument bindings go into `bindings`, since positions are
770
- // different for bindings from arguments and bindings from body.
771
- tpd.Inlined (call, finalBindings, finalExpansion)
731
+ // Take care that only argument bindings go into `bindings`, since positions are
732
+ // different for bindings from arguments and bindings from body.
733
+ tpd.Inlined (call, finalBindings, finalExpansion)
772
734
}
773
735
}
774
736
0 commit comments