[NI] Make subtyping algorithm more robust to error types
During subtyping/incorporation we transform types (e.g. changing nullability, form of the type) and, basically, we're doing this to some FIXPOINT. It's important that we use `KotlinType.hashCode()` to compare types, but for error types hashCode is a hashCode of its supertype and, for example, `makeNullableAsSpecified` method recreate type every time. So, we continue to generate new constraints and we'll never stop incorporation algorithm
This commit is contained in:
@@ -9565,6 +9565,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/constraints/equalityConstraintOnNullableType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("errorUpperBoundConstraint.kt")
|
||||
public void testErrorUpperBoundConstraint() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/constraints/errorUpperBoundConstraint.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ignoreConstraintFromImplicitInNothing.kt")
|
||||
public void testIgnoreConstraintFromImplicitInNothing() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/constraints/ignoreConstraintFromImplicitInNothing.kt");
|
||||
|
||||
Reference in New Issue
Block a user