Skip to content

Commit

Permalink
Add extend the check for targetName when checking matching members
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzaremmal committed Nov 30, 2023
1 parent 582192d commit ea509f4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2084,9 +2084,10 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
ExprType(info1.resType)
case info1 => info1

(isSubInfo(info1, info2, m.symbol.info.orElse(info1)) && m.symbol.hasTargetName(m.symbol.name))
|| matchAbstractTypeMember(m.info)
|| (tp1.isStable && m.symbol.isStableMember && isSubType(TermRef(tp1, m.symbol), tp2.refinedInfo))
m.symbol.hasTargetName(m.symbol.name) && (
isSubInfo(info1, info2, m.symbol.info.orElse(info1))
|| matchAbstractTypeMember(m.info)
|| (tp1.isStable && m.symbol.isStableMember && isSubType(TermRef(tp1, m.symbol), tp2.refinedInfo)))
end qualifies

tp1.member(name).hasAltWithInline(qualifies)
Expand Down

0 comments on commit ea509f4

Please sign in to comment.