Skip to content

Commit 25c6d3b

Browse files
oderskymichelou
authored andcommitted
Avoid testing with eq
1 parent d0ae726 commit 25c6d3b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,8 @@ object TypeOps:
344344
tp match {
345345
case tp: OrType =>
346346
(tp.tp1.dealias, tp.tp2.dealias) match
347-
case (tp1 @ AppliedType(tycon1, args1), tp2 @ AppliedType(tycon2, args2)) if tycon1 eq tycon2 =>
347+
case (tp1 @ AppliedType(tycon1, args1), tp2 @ AppliedType(tycon2, args2))
348+
if tycon1.typeSymbol == tycon2.typeSymbol && (tycon1 =:= tycon2) =>
348349
mergeRefinedOrApplied(tp1, tp2)
349350
case (tp1, tp2) =>
350351
approximateOr(tp1, tp2)

0 commit comments

Comments
 (0)