@@ -691,11 +691,22 @@ object TypeOps:
691
691
val hiBound = instantiate(bounds.hi, skolemizedArgTypes)
692
692
val loBound = instantiate(bounds.lo, skolemizedArgTypes)
693
693
694
- def check (using Context ) = {
695
- if (! (lo <:< hiBound)) violations += ((arg, " upper" , hiBound))
696
- if (! (loBound <:< hi)) violations += ((arg, " lower" , loBound))
694
+ def check (tp1 : Type , tp2 : Type , which : String , bound : Type )(using Context ) = {
695
+ val isSub = TypeComparer .explaining { cmp =>
696
+ val isSub = cmp.isSubType(tp1, tp2)
697
+ if ! isSub then
698
+ if ! ctx.typerState.constraint.domainLambdas.isEmpty then
699
+ typr.println(i " ${ctx.typerState.constraint}" )
700
+ if ! ctx.gadt.symbols.isEmpty then
701
+ typr.println(i " ${ctx.gadt}" )
702
+ typr.println(cmp.lastTrace(i " checkOverlapsBounds( $lo, $hi, $arg, $bounds)( $which) " ))
703
+ // trace.dumpStack()
704
+ isSub
705
+ }// (using ctx.fresh.setSetting(ctx.settings.verbose, true)) // uncomment to enable moreInfo in ExplainingTypeComparer recur
706
+ if ! isSub then violations += ((arg, which, bound))
697
707
}
698
- check(using checkCtx)
708
+ check(lo, hiBound, " upper" , hiBound)(using checkCtx)
709
+ check(loBound, hi, " lower" , loBound)(using checkCtx)
699
710
}
700
711
701
712
def loop (args : List [Tree ], boundss : List [TypeBounds ]): Unit = args match
0 commit comments