Support flexible types in TypeCheckingProcedure

This commit is contained in:
Andrey Breslav
2014-06-24 17:54:43 +04:00
parent a2f8def1e8
commit 687fdce30a
@@ -163,6 +163,12 @@ public class TypeCheckingProcedure {
}
public boolean isSubtypeOf(@NotNull JetType subtype, @NotNull JetType supertype) {
if (subtype instanceof FlexibleType) {
return isSubtypeOf(((FlexibleType) subtype).getLowerBound(), supertype);
}
if (supertype instanceof FlexibleType) {
return isSubtypeOf(subtype, ((FlexibleType) supertype).getUpperBound());
}
if (subtype.isError() || supertype.isError()) {
return true;
}