Skip to content

Commit 2301c98

Browse files
committed
Add missing Inlined node
1 parent 815e4db commit 2301c98

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,10 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
450450
else paramSpan(tree.name)
451451
paramProxy.get(tree.tpe) match {
452452
case Some(t) if tree.isTerm && t.isSingleton =>
453-
singleton(t.dealias).withSpan(span)
453+
t.dealias match {
454+
case tp: ConstantType => Inlined(EmptyTree, Nil, singleton(tp).withSpan(span)).withSpan(tree.span)
455+
case tp => singleton(tp).withSpan(span)
456+
}
454457
case Some(t) if tree.isType =>
455458
TypeTree(t).withSpan(span)
456459
case _ => tree
@@ -885,6 +888,8 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
885888
case _ =>
886889
false
887890
}
891+
case Inlined(EmptyTree, Nil, ipat) =>
892+
reducePattern(bindingsBuf, fromBuf, toBuf, scrut, ipat)
888893
case _ => false
889894
}
890895
}

0 commit comments

Comments
 (0)