Skip to content

Commit 9106bf1

Browse files
committed
Add case for Inlined to TypedTreeCopier
The missing case was discovered after inlining `implicitly`. It produced a type mismatch in Ycheck after lambda lift.
1 parent 9b6d0c0 commit 9106bf1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,15 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
560560
}
561561
}
562562

563+
override def Inlined(tree: Tree)(call: Tree, bindings: List[MemberDef], expansion: Tree)(implicit ctx: Context): Inlined = {
564+
val tree1 = untpd.cpy.Inlined(tree)(call, bindings, expansion)
565+
tree match {
566+
case tree: Inlined if sameTypes(bindings, tree.bindings) && (expansion.tpe eq tree.expansion.tpe) =>
567+
tree1.withTypeUnchecked(tree.tpe)
568+
case _ => ta.assignType(tree1, bindings, expansion)
569+
}
570+
}
571+
563572
override def SeqLiteral(tree: Tree)(elems: List[Tree], elemtpt: Tree)(implicit ctx: Context): SeqLiteral = {
564573
val tree1 = untpd.cpy.SeqLiteral(tree)(elems, elemtpt)
565574
tree match {

0 commit comments

Comments
 (0)