[FIR] Set isStubTypeEqualsToAnything = true for inference as in FE 1.0

#KT-43616 Fixed
This commit is contained in:
Mikhail Glukhikh
2020-11-26 18:18:34 +03:00
parent eae8821dec
commit 2429f429c5
12 changed files with 131 additions and 18 deletions
+2 -2
View File
@@ -70,7 +70,7 @@ fun <T : Any?> test(value: T, value2: T) {
}
}
val x7: Any = { // BLOCK
val <elvis>: T? = { // BLOCK
val <elvis>: T = { // BLOCK
val <elvis>: T? = magic<T?>()
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> value
@@ -79,7 +79,7 @@ fun <T : Any?> test(value: T, value2: T) {
}
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> 42
else -> <elvis> /*as T */
else -> <elvis>
}
}
}
+5 -6
View File
@@ -137,12 +137,12 @@ FILE fqName:<root> fileName:/kt30796.kt
then: GET_VAR 'val tmp_8: T of <root>.test [val] declared in <root>.test' type=T of <root>.test origin=null
VAR name:x7 type:kotlin.Any [val]
BLOCK type=kotlin.Any origin=ELVIS
VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:T of <root>.test? [val]
BLOCK type=T of <root>.test? origin=ELVIS
VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:T of <root>.test [val]
BLOCK type=T of <root>.test origin=ELVIS
VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:T of <root>.test? [val]
CALL 'public final fun magic <T> (): T of <root>.magic declared in <root>' type=T of <root>.test? origin=null
<T>: T of <root>.test?
WHEN type=T of <root>.test? origin=ELVIS
WHEN type=T of <root>.test origin=ELVIS
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp_11: T of <root>.test? [val] declared in <root>.test' type=T of <root>.test? origin=null
@@ -155,10 +155,9 @@ FILE fqName:<root> fileName:/kt30796.kt
WHEN type=kotlin.Any origin=ELVIS
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp_10: T of <root>.test? [val] declared in <root>.test' type=T of <root>.test? origin=null
arg0: GET_VAR 'val tmp_10: T of <root>.test [val] declared in <root>.test' type=T of <root>.test origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: CONST Int type=kotlin.Int value=42
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=T of <root>.test origin=IMPLICIT_CAST typeOperand=T of <root>.test
GET_VAR 'val tmp_10: T of <root>.test? [val] declared in <root>.test' type=T of <root>.test? origin=null
then: GET_VAR 'val tmp_10: T of <root>.test [val] declared in <root>.test' type=T of <root>.test origin=null