psi2ir: additional tests for dynamic expressions: '?:', '!!'
This commit is contained in:
@@ -0,0 +1 @@
|
||||
fun test(d: dynamic) = d ?: "other"
|
||||
@@ -0,0 +1,17 @@
|
||||
FILE fqName:<root> fileName:/dynamicElvisOperator.kt
|
||||
FUN name:test visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic flags:
|
||||
VALUE_PARAMETER name:d index:0 type:dynamic flags:
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='test(dynamic): dynamic'
|
||||
BLOCK type=dynamic origin=ELVIS
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp0_elvis_lhs type:dynamic flags:val
|
||||
GET_VAR 'value-parameter d: dynamic' type=dynamic origin=null
|
||||
WHEN type=dynamic origin=null
|
||||
BRANCH
|
||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_VAR 'tmp0_elvis_lhs: dynamic' type=dynamic origin=null
|
||||
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||
then: CONST String type=kotlin.String value="other"
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: GET_VAR 'tmp0_elvis_lhs: dynamic' type=dynamic origin=null
|
||||
@@ -0,0 +1 @@
|
||||
fun test(d: dynamic) = d!!
|
||||
@@ -0,0 +1,17 @@
|
||||
FILE fqName:<root> fileName:/dynamicExclExclOperator.kt
|
||||
FUN name:test visibility:public modality:FINAL <> (d:dynamic) returnType:dynamic flags:
|
||||
VALUE_PARAMETER name:d index:0 type:dynamic flags:
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='test(dynamic): dynamic'
|
||||
BLOCK type=dynamic origin=EXCLEXCL
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp0_notnull type:dynamic flags:val
|
||||
GET_VAR 'value-parameter d: dynamic' type=dynamic origin=null
|
||||
WHEN type=dynamic origin=null
|
||||
BRANCH
|
||||
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_VAR 'tmp0_notnull: dynamic' type=dynamic origin=null
|
||||
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||
then: CALL 'THROW_NPE(): Nothing' type=kotlin.Nothing origin=EXCLEXCL
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: GET_VAR 'tmp0_notnull: dynamic' type=dynamic origin=null
|
||||
@@ -91,6 +91,16 @@ public class IrJsTextTestCaseGenerated extends AbstractIrJsTextTestCase {
|
||||
runTest("compiler/testData/ir/irJsText/dynamic/dynamicCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("dynamicElvisOperator.kt")
|
||||
public void testDynamicElvisOperator() throws Exception {
|
||||
runTest("compiler/testData/ir/irJsText/dynamic/dynamicElvisOperator.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("dynamicExclExclOperator.kt")
|
||||
public void testDynamicExclExclOperator() throws Exception {
|
||||
runTest("compiler/testData/ir/irJsText/dynamic/dynamicExclExclOperator.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("dynamicMemberAccess.kt")
|
||||
public void testDynamicMemberAccess() throws Exception {
|
||||
runTest("compiler/testData/ir/irJsText/dynamic/dynamicMemberAccess.kt");
|
||||
|
||||
Reference in New Issue
Block a user