[FIR2IR] Properly approximate intersection types during fir2ir conversion
^KT-62544 Fixed
This commit is contained in:
committed by
Space Team
parent
8c6da9fddb
commit
9366847e96
Vendored
+8
-9
@@ -179,16 +179,16 @@ FILE fqName:<root> fileName:/caoWithAdaptationForSam.kt
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:<root>.A [val]
|
||||
GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:<root>.IFoo [val]
|
||||
TYPE_OP type=<root>.IFoo origin=IMPLICIT_CAST typeOperand=<root>.IFoo
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Any [val]
|
||||
TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
|
||||
GET_VAR 'fn: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test4' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
|
||||
CALL 'public final fun set (i: <root>.IFoo, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
$receiver: GET_VAR 'val tmp_6: <root>.A declared in <root>.test4' type=<root>.A origin=null
|
||||
i: GET_VAR 'val tmp_7: <root>.IFoo declared in <root>.test4' type=<root>.IFoo origin=null
|
||||
i: GET_VAR 'val tmp_7: kotlin.Any declared in <root>.test4' type=kotlin.Any origin=null
|
||||
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=null
|
||||
$receiver: GET_VAR 'val tmp_6: <root>.A declared in <root>.test4' type=<root>.A origin=null
|
||||
i: GET_VAR 'val tmp_7: <root>.IFoo declared in <root>.test4' type=<root>.IFoo origin=null
|
||||
i: GET_VAR 'val tmp_7: kotlin.Any declared in <root>.test4' type=kotlin.Any origin=null
|
||||
other: CONST Int type=kotlin.Int value=1
|
||||
FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:a index:0 type:kotlin.Any
|
||||
@@ -225,14 +225,13 @@ FILE fqName:<root> fileName:/caoWithAdaptationForSam.kt
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:<root>.A [val]
|
||||
GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.Function1<kotlin.Int, kotlin.Unit> [val]
|
||||
TYPE_OP type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=IMPLICIT_CAST typeOperand=kotlin.Function1<kotlin.Int, kotlin.Unit>
|
||||
GET_VAR 'a: kotlin.Any declared in <root>.test6' type=kotlin.Any origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.Any [val]
|
||||
GET_VAR 'a: kotlin.Any declared in <root>.test6' type=kotlin.Any origin=null
|
||||
CALL 'public final fun set (i: <root>.IFoo, newValue: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
$receiver: GET_VAR 'val tmp_10: <root>.A declared in <root>.test6' type=<root>.A origin=null
|
||||
i: GET_VAR 'val tmp_11: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test6' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
|
||||
i: GET_VAR 'val tmp_11: kotlin.Any declared in <root>.test6' type=kotlin.Any origin=null
|
||||
newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun get (i: <root>.IFoo): kotlin.Int declared in <root>' type=kotlin.Int origin=null
|
||||
$receiver: GET_VAR 'val tmp_10: <root>.A declared in <root>.test6' type=<root>.A origin=null
|
||||
i: GET_VAR 'val tmp_11: kotlin.Function1<kotlin.Int, kotlin.Unit> declared in <root>.test6' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
|
||||
i: GET_VAR 'val tmp_11: kotlin.Any declared in <root>.test6' type=kotlin.Any origin=null
|
||||
other: CONST Int type=kotlin.Int value=1
|
||||
|
||||
Vendored
+2
-2
@@ -84,7 +84,7 @@ fun test4(fn: Function1<Int, Unit>) {
|
||||
fn is IFoo -> { // BLOCK
|
||||
{ // BLOCK
|
||||
val tmp_6: A = A
|
||||
val tmp_7: IFoo = fn /*as IFoo */
|
||||
val tmp_7: Any = fn /*as Any */
|
||||
tmp_6.set(i = tmp_7, newValue = tmp_6.get(i = tmp_7).plus(other = 1))
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ fun test6(a: Any) {
|
||||
a /*as Function1<Int, Unit> */ as IFoo /*~> Unit */
|
||||
{ // BLOCK
|
||||
val tmp_10: A = A
|
||||
val tmp_11: Function1<Int, Unit> = a /*as Function1<Int, Unit> */
|
||||
val tmp_11: Any = a
|
||||
tmp_10.set(i = tmp_11, newValue = tmp_10.get(i = tmp_11).plus(other = 1))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user