Skip to content

Commit

Permalink
Rework ParamRef#underlying handling in disjointnessBoundary
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Mar 4, 2024
1 parent db1dcdc commit d687dee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2857,14 +2857,19 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
tp
case tp: HKTypeLambda =>
tp
case tp: ParamRef =>
val st = tp.superTypeNormalized
if st.exists then
disjointnessBoundary(st)
else
// workaround for when ParamRef#underlying returns NoType
defn.AnyType
case tp: TypeProxy =>
disjointnessBoundary(tp.superTypeNormalized)
case tp: WildcardType =>
disjointnessBoundary(tp.effectiveBounds.hi)
case tp: ErrorType =>
defn.AnyType
case NoType => // ParamRef#superTypeNormalized can return NoType
defn.AnyType
end disjointnessBoundary

(disjointnessBoundary(tp1), disjointnessBoundary(tp2)) match
Expand Down

0 comments on commit d687dee

Please sign in to comment.