FIR2IR: avoid redundant implicit cast creation
Related to KT-62544
This commit is contained in:
committed by
Space Team
parent
ba06af9d7f
commit
168b3416ea
@@ -68,13 +68,9 @@ FILE fqName:<root> fileName:/smartCastAside.kt
|
||||
then: BLOCK type=kotlin.Unit origin=null
|
||||
CALL 'public abstract fun foo (): kotlin.Unit declared in <root>.A' type=kotlin.Unit origin=null
|
||||
$this: TYPE_OP type=<root>.C origin=IMPLICIT_CAST typeOperand=<root>.C
|
||||
TYPE_OP type=<root>.A origin=IMPLICIT_CAST typeOperand=<root>.A
|
||||
GET_VAR 'param: <root>.B declared in <root>.test' type=<root>.B origin=null
|
||||
GET_VAR 'param: <root>.B declared in <root>.test' type=<root>.B origin=null
|
||||
CALL 'public abstract fun bar (): kotlin.Unit declared in <root>.B' type=kotlin.Unit origin=null
|
||||
$this: TYPE_OP type=<root>.B origin=IMPLICIT_CAST typeOperand=<root>.B
|
||||
TYPE_OP type=<root>.A origin=IMPLICIT_CAST typeOperand=<root>.A
|
||||
GET_VAR 'param: <root>.B declared in <root>.test' type=<root>.B origin=null
|
||||
$this: GET_VAR 'param: <root>.B declared in <root>.test' type=<root>.B origin=null
|
||||
CALL 'public abstract fun baz (): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
|
||||
$this: TYPE_OP type=<root>.C origin=IMPLICIT_CAST typeOperand=<root>.C
|
||||
TYPE_OP type=<root>.A origin=IMPLICIT_CAST typeOperand=<root>.A
|
||||
GET_VAR 'param: <root>.B declared in <root>.test' type=<root>.B origin=null
|
||||
GET_VAR 'param: <root>.B declared in <root>.test' type=<root>.B origin=null
|
||||
|
||||
@@ -16,9 +16,9 @@ interface C : A {
|
||||
fun test(param: B) {
|
||||
when {
|
||||
param is C -> { // BLOCK
|
||||
param /*as A */ /*as C */.foo()
|
||||
param /*as A */ /*as B */.bar()
|
||||
param /*as A */ /*as C */.baz()
|
||||
param /*as C */.foo()
|
||||
param.bar()
|
||||
param /*as C */.baz()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user