IR: IMPLICIT_DYNAMIC_CAST

Generate IMPLICIT_DYNAMIC_CAST for implicit casts from `dynamic` to `T`
This commit is contained in:
Dmitry Petrov
2019-04-16 12:52:22 +03:00
parent 422c13bd03
commit 760806a1ac
11 changed files with 79 additions and 50 deletions
@@ -4,20 +4,20 @@ FILE fqName:<root> fileName:/dynamicAndMembersOfAny.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1 (d: dynamic): kotlin.String declared in <root>'
CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
$this: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
$this: TYPE_OP type=kotlin.Any origin=IMPLICIT_DYNAMIC_CAST typeOperand=kotlin.Any
GET_VAR 'd: dynamic declared in <root>.test1' type=dynamic origin=null
FUN name:test2 visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Int
VALUE_PARAMETER name:d index:0 type:dynamic
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test2 (d: dynamic): kotlin.Int declared in <root>'
CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null
$this: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
$this: TYPE_OP type=kotlin.Any origin=IMPLICIT_DYNAMIC_CAST typeOperand=kotlin.Any
GET_VAR 'd: dynamic declared in <root>.test2' type=dynamic origin=null
FUN name:test3 visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Boolean
VALUE_PARAMETER name:d index:0 type:dynamic
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test3 (d: dynamic): kotlin.Boolean declared in <root>'
CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
$this: TYPE_OP type=kotlin.Any origin=IMPLICIT_DYNAMIC_CAST typeOperand=kotlin.Any
GET_VAR 'd: dynamic declared in <root>.test3' type=dynamic origin=null
other: CONST Int type=kotlin.Int value=42