File tree 1 file changed +15
-1
lines changed
compiler/src/dotty/tools/dotc/core
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] {
1973
1973
// instantiated to `Any` belongs to both types.
1974
1974
true
1975
1975
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
+ }
1977
1991
}
1978
1992
case (tp1 : HKLambda , tp2 : HKLambda ) =>
1979
1993
intersecting(tp1.resType, tp2.resType)
You can’t perform that action at this time.
0 commit comments