[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:
Mikhail Zarechenskiy
2018-06-07 11:48:16 +03:00
parent 1ee37b1772
commit 9891f562cc
15 changed files with 94 additions and 20 deletions
@@ -10,7 +10,7 @@ class A {
val a get() = <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>b<!>
val b get() = <!NI;DEBUG_INFO_MISSING_UNRESOLVED, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>a<!>
val z1 get() = id(<!NI;DEBUG_INFO_MISSING_UNRESOLVED, OI;DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>z1<!>)
val <!NI;IMPLICIT_NOTHING_PROPERTY_TYPE!>z1<!> get() = id(<!NI;DEBUG_INFO_MISSING_UNRESOLVED, OI;DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>z1<!>)
val z2 get() = l(<!NI;DEBUG_INFO_MISSING_UNRESOLVED, OI;DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>z2<!>)
val u get() = <!UNRESOLVED_REFERENCE!>field<!>
@@ -10,8 +10,8 @@ public final class A {
public final val b: [ERROR : Error function type]
public final val u: [ERROR : Error function type]
public final val y: [ERROR : Error function type]
public final val z1: [ERROR : Error type for ParseError-argument VALUE_ARGUMENT]
public final val z2: kotlin.collections.List<[ERROR : Error type for ParseError-argument VALUE_ARGUMENT]>
public final val z1: kotlin.Nothing
public final val z2: kotlin.collections.List<kotlin.Nothing>
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String