Skip to content

Commit b856538

Browse files
Disable distribution of intersection types over applied types
1 parent 7061975 commit b856538

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2770,16 +2770,6 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
27702770
* @pre !(tp1 <: tp2) && !(tp2 <:< tp1) -- these cases were handled before
27712771
*/
27722772
private def distributeAnd(tp1: Type, tp2: Type): Type = tp1 match {
2773-
case tp1 @ AppliedType(tycon1, args1) =>
2774-
tp2 match {
2775-
case AppliedType(tycon2, args2)
2776-
if tycon1.typeSymbol == tycon2.typeSymbol && tycon1 =:= tycon2 =>
2777-
val jointArgs = glbArgs(args1, args2, tycon1.typeParams)
2778-
if (jointArgs.forall(_.exists)) (tycon1 & tycon2).appliedTo(jointArgs)
2779-
else NoType
2780-
case _ =>
2781-
NoType
2782-
}
27832773
case tp1: RefinedType =>
27842774
// opportunistically merge same-named refinements
27852775
// this does not change anything semantically (i.e. merging or not merging

0 commit comments

Comments
 (0)