File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1973,7 +1973,21 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
19731973 // instantiated to `Any` belongs to both types.
19741974 true
19751975 else
1976- isSameType(arg1, arg2) // TODO: handle uninstanciated types
1976+ isSameType(arg1, arg2) || {
1977+ // We can only trust a "no" from `isSameType` when both
1978+ // `arg1` and `arg2` are fully instantiated.
1979+ val fullyInstantiated = new TypeAccumulator [Boolean ] {
1980+ override def apply (x : Boolean , t : Type ) =
1981+ x && {
1982+ t match {
1983+ case _ : SkolemType | _ : TypeVar | _ : TypeParamRef => false
1984+ case _ => foldOver(x, t)
1985+ }
1986+ }
1987+ }
1988+ ! (fullyInstantiated.apply(true , arg1) &&
1989+ fullyInstantiated.apply(true , arg2))
1990+ }
19771991 }
19781992 case (tp1 : HKLambda , tp2 : HKLambda ) =>
19791993 intersecting(tp1.resType, tp2.resType)
You can’t perform that action at this time.
0 commit comments