File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -524,17 +524,21 @@ trait ConstraintHandling[AbstractContext] {
524524 pruneLambdaParams(bound)
525525 }
526526
527- def sameKind (tp1 : Type , tp2 : Type ): Boolean =
528- tp1.typeParams.corresponds(tp2.typeParams)((p1, p2) =>
529- sameKind(p1.paramInfo, p2.paramInfo))
527+ def kindCompatible (tp1 : Type , tp2 : Type ): Boolean =
528+ val tparams1 = tp1.typeParams
529+ val tparams2 = tp2.typeParams
530+ tparams1.corresponds(tparams2)((p1, p2) => kindCompatible(p1.paramInfo, p2.paramInfo))
531+ && (tparams1.isEmpty || kindCompatible(tp1.hkResult, tp2.hkResult))
532+ || tp1.hasAnyKind
533+ || tp2.hasAnyKind
530534
531535 try bound match {
532536 case bound : TypeParamRef if constraint contains bound =>
533537 addParamBound(bound)
534538 case _ =>
535539 val pbound = prune(bound)
536540 pbound.exists
537- && sameKind (param, pbound)
541+ && kindCompatible (param, pbound)
538542 && (if fromBelow then addLowerBound(param, pbound) else addUpperBound(param, pbound))
539543 }
540544 finally addConstraintInvocations -= 1
You can’t perform that action at this time.
0 commit comments