0857b9c9e7
Namely, remove incorporation “otherInsideMyConstraint” to eliminate constraint system redundancy and produce a potentially very large number of constructs. Instead, introduce not so “spreadable” incorporation during variable fixation (equality constraint with result type into other constraints). ^KT-41644 Fixed ^KT-42195 Fixed ^KT-42920 Fixed ^KT-42791 Fixed ^KT-41741 Fixed
35 lines
725 B
Kotlin
Vendored
35 lines
725 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
// SKIP_TXT
|
|
|
|
class ExcA : Exception()
|
|
|
|
class ExcB(val map: Map<Int, Int>) : Exception()
|
|
|
|
fun test0(): List<Int> = run {
|
|
try {
|
|
emptyList()
|
|
} finally {
|
|
<!UNUSED_EXPRESSION!>""<!>
|
|
fun foo() {}
|
|
}
|
|
}
|
|
|
|
fun test1(): Map<Int, Int> = run {
|
|
try {
|
|
emptyMap()
|
|
} catch (e: ExcA) {
|
|
emptyMap()
|
|
} catch (e: ExcB) {
|
|
e.map
|
|
} finally {
|
|
<!UNUSED_EXPRESSION!>""<!>
|
|
}
|
|
}
|
|
|
|
fun test2(): Map<Int, Int> = run {
|
|
<!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, NI;TYPE_MISMATCH!>try {
|
|
emptyMap()
|
|
} catch (e: ExcA) {
|
|
<!NI;TYPE_MISMATCH, OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>mapOf(<!NI;TYPE_MISMATCH!>"" to ""<!>)<!>
|
|
}<!>
|
|
} |