[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
@@ -1,18 +1,18 @@
// !WITH_NEW_INFERENCE
fun test() {
run {<!RETURN_NOT_ALLOWED!>return<!>}
run {}
<!NI;UNREACHABLE_CODE!>run {}<!>
}
fun test2() {
run {<!RETURN_NOT_ALLOWED!>return@test2<!>}
run {}
<!NI;UNREACHABLE_CODE!>run {}<!>
}
fun test3() {
fun test4() {
run {<!RETURN_NOT_ALLOWED!>return@test3<!>}
run {}
<!NI;UNREACHABLE_CODE!>run {}<!>
}
}