File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
compiler/src/dotty/tools/dotc/inlines Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -877,8 +877,12 @@ class Inliner(val call: tpd.Tree)(using Context):
877877 }
878878 case _ => rhs0
879879 }
880- val (usedBindings, rhs2) = dropUnusedDefs(caseBindings, rhs1)
881- val rhs = seq(usedBindings, rhs2)
880+ val rhs2 = rhs1 match {
881+ case Typed (expr, tpt) if rhs1.span.isSynthetic => constToLiteral(expr)
882+ case _ => constToLiteral(rhs1)
883+ }
884+ val (usedBindings, rhs3) = dropUnusedDefs(caseBindings, rhs2)
885+ val rhs = seq(usedBindings, rhs3)
882886 inlining.println(i """ --- reduce:
883887 | $tree
884888 |--- to:
Original file line number Diff line number Diff line change 1+ transparent inline def f : String =
2+ inline 10 match
3+ case _ =>
4+ inline Some [" foo" ](" foo" ) match
5+ case Some (x) => x
6+
7+ def test =
8+ inline val failMsg = f
You can’t perform that action at this time.
0 commit comments