Skip to content

Commit 3f96efe

Browse files
committed
Address review comments
1 parent 158ccd7 commit 3f96efe

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

compiler/src/dotty/tools/dotc/core/Denotations.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ object Denotations {
663663
tp1.derivedLambdaType(
664664
mergeParamNames(tp1, tp2),
665665
tp1.paramInfos,
666-
tp1.resultType | tp2.resultType.subst(tp2, tp1))
666+
infoJoin(tp1.resultType, tp2.resultType.subst(tp2, tp1), sym1, sym2))
667667
case _ =>
668668
mergeConflict(sym1, sym2, tp1, tp2)
669669
}
@@ -676,7 +676,7 @@ object Denotations {
676676
tp1.paramInfos.zipWithConserve(tp2.paramInfos) { (p1, p2) =>
677677
(p1 | p2.subst(tp2, tp1)).bounds
678678
},
679-
tp1.resultType | tp2.resultType.subst(tp2, tp1))
679+
infoJoin(tp1.resultType, tp2.resultType.subst(tp2, tp1), sym1, sym2))
680680
case _ =>
681681
mergeConflict(sym1, sym2, tp1, tp2)
682682
}

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

+7-6
Original file line numberDiff line numberDiff line change
@@ -1643,12 +1643,13 @@ class TypeComparer(initctx: Context) extends ConstraintHandling {
16431643
case tp1: RefinedType =>
16441644
tp2 match {
16451645
case tp2: RefinedType if tp1.refinedName == tp2.refinedName =>
1646-
val jointInfo =
1647-
try Denotations.infoMeet(tp1.refinedInfo, tp2.refinedInfo, NoSymbol, NoSymbol, safeIntersection = false)
1648-
catch {
1649-
case ex: MergeError => NoType
1650-
}
1651-
tp1.derivedRefinedType(tp1.parent & tp2.parent, tp1.refinedName, jointInfo)
1646+
try {
1647+
val jointInfo = Denotations.infoMeet(tp1.refinedInfo, tp2.refinedInfo, NoSymbol, NoSymbol, safeIntersection = false)
1648+
tp1.derivedRefinedType(tp1.parent & tp2.parent, tp1.refinedName, jointInfo)
1649+
}
1650+
catch {
1651+
case ex: MergeError => tp1.parent & tp2.parent
1652+
}
16521653
case _ =>
16531654
NoType
16541655
}

0 commit comments

Comments
 (0)