From 92a7ecfac7d9df1c4e398d493a0657706961b4d9 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Fri, 26 Aug 2016 17:16:42 +0300 Subject: [PATCH] Render return target for IrReturn in tests. Add tests for non-local returns from lambdas. --- .../kotlin/ir/util/RenderIrElement.kt | 2 +- .../ir/irText/classes/classMembers.txt | 6 +-- .../ir/irText/expressions/arrayAccess.txt | 4 +- .../ir/irText/expressions/arrayAssignment.txt | 2 +- .../expressions/arrayAugmentedAssignment1.txt | 4 +- .../irText/expressions/booleanOperators.txt | 8 ++-- .../testData/ir/irText/expressions/boxOk.txt | 2 +- .../callWithReorderedArguments.txt | 8 ++-- .../testData/ir/irText/expressions/calls.txt | 12 ++--- .../irText/expressions/chainOfSafeCalls.txt | 6 +-- .../expressions/conventionComparisons.txt | 8 ++-- .../ir/irText/expressions/dotQualified.txt | 4 +- .../testData/ir/irText/expressions/elvis.txt | 16 +++---- .../ir/irText/expressions/equality.txt | 6 +-- .../extensionPropertyGetterCall.txt | 4 +- .../expressions/forWithImplicitReceivers.txt | 6 +-- .../ir/irText/expressions/identity.txt | 6 +-- .../ir/irText/expressions/ifElseIf.txt | 2 +- .../implicitCastOnPlatformType.txt | 2 +- .../testData/ir/irText/expressions/in.txt | 8 ++-- .../expressions/primitiveComparisons.txt | 48 +++++++++---------- .../ir/irText/expressions/references.txt | 14 +++--- .../safeCallWithIncrementDecrement.txt | 6 +-- .../ir/irText/expressions/safeCalls.txt | 10 ++-- .../ir/irText/expressions/simpleOperators.txt | 22 ++++----- .../expressions/simpleUnaryOperators.txt | 12 ++--- .../ir/irText/expressions/smartCasts.txt | 14 +++--- .../smartCastsWithDestructuring.txt | 6 +-- .../testData/ir/irText/expressions/smoke.txt | 6 +-- .../irText/expressions/stringComparisons.txt | 8 ++-- .../ir/irText/expressions/stringPlus.txt | 6 +-- .../ir/irText/expressions/tryCatch.txt | 2 +- .../expressions/tryCatchWithImplicitCast.txt | 2 +- .../ir/irText/expressions/typeOperators.txt | 8 ++-- .../testData/ir/irText/expressions/values.txt | 8 ++-- .../expressions/varargWithImplicitCast.txt | 8 ++-- .../expressions/variableAsFunctionCall.txt | 12 ++--- .../testData/ir/irText/expressions/when.txt | 6 +-- .../ir/irText/lambdas/extensionLambda.txt | 4 +- .../testData/ir/irText/lambdas/justLambda.txt | 2 +- .../lambdas/multipleImplicitReceivers.txt | 10 ++-- .../ir/irText/lambdas/nonLocalReturn.kt | 18 +++++++ .../ir/irText/lambdas/nonLocalReturn.txt | 25 ++++++++++ .../kotlin/ir/IrTextTestCaseGenerated.java | 6 +++ 44 files changed, 214 insertions(+), 165 deletions(-) create mode 100644 compiler/testData/ir/irText/lambdas/nonLocalReturn.kt create mode 100644 compiler/testData/ir/irText/lambdas/nonLocalReturn.txt diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt index fc61548bd07..c545b7d9498 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt @@ -82,7 +82,7 @@ class RenderIrElementVisitor : IrElementVisitor { "BLOCK type=${expression.type.render()} operator=${expression.operator}" override fun visitReturn(expression: IrReturn, data: Nothing?): String = - "RETURN type=${expression.type.render()}" + "RETURN type=${expression.type.render()} from=${expression.returnTarget.name}" override fun visitGetExtensionReceiver(expression: IrGetExtensionReceiver, data: Nothing?): String = "\$RECEIVER of: ${expression.descriptor.containingDeclaration.name} type=${expression.type.render()}" diff --git a/compiler/testData/ir/irText/classes/classMembers.txt b/compiler/testData/ir/irText/classes/classMembers.txt index 776a21a94a8..ac6ec38837f 100644 --- a/compiler/testData/ir/irText/classes/classMembers.txt +++ b/compiler/testData/ir/irText/classes/classMembers.txt @@ -23,12 +23,12 @@ FILE /classMembers.kt PROPERTY public final val propertyWithGet: kotlin.Int getter= setter=null PROPERTY_GETTER public final fun (): kotlin.Int property=propertyWithGet BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= CONST Int type=kotlin.Int value='42' PROPERTY public final var propertyWithGetAndSet: kotlin.Int getter= setter= PROPERTY_GETTER public final fun (): kotlin.Int property=propertyWithGetAndSet BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= CALL . type=kotlin.Int operator=GET_PROPERTY $this: THIS public final class C type=C PROPERTY_SETTER public final fun (/*0*/ value: kotlin.Int): kotlin.Unit property=propertyWithGetAndSet @@ -57,7 +57,7 @@ FILE /classMembers.kt FUN public abstract fun foo(): kotlin.Unit FUN public open fun bar(): kotlin.Unit BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=bar CALL .foo type=kotlin.Unit operator=null $this: THIS public interface NestedInterface type=C.NestedInterface CLASS OBJECT Companion diff --git a/compiler/testData/ir/irText/expressions/arrayAccess.txt b/compiler/testData/ir/irText/expressions/arrayAccess.txt index 1557624afb1..2faf248457a 100644 --- a/compiler/testData/ir/irText/expressions/arrayAccess.txt +++ b/compiler/testData/ir/irText/expressions/arrayAccess.txt @@ -4,11 +4,11 @@ FILE /arrayAccess.kt CONST Int type=kotlin.Int value='0' FUN public fun foo(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=foo CONST Int type=kotlin.Int value='1' FUN public fun test(/*0*/ a: kotlin.IntArray): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test CALL .plus type=kotlin.Int operator=PLUS $this: CALL .plus type=kotlin.Int operator=PLUS $this: CALL .get type=kotlin.Int operator=GET_ARRAY_ELEMENT diff --git a/compiler/testData/ir/irText/expressions/arrayAssignment.txt b/compiler/testData/ir/irText/expressions/arrayAssignment.txt index 7acc3a25856..562c07eb199 100644 --- a/compiler/testData/ir/irText/expressions/arrayAssignment.txt +++ b/compiler/testData/ir/irText/expressions/arrayAssignment.txt @@ -13,7 +13,7 @@ FILE /arrayAssignment.kt value: CONST Int type=kotlin.Int value='0' FUN public fun foo(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=foo CONST Int type=kotlin.Int value='1' FUN public fun test2(): kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt index 532fc031db6..127e1fe51fc 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt @@ -1,7 +1,7 @@ FILE /arrayAugmentedAssignment1.kt FUN public fun foo(): kotlin.IntArray BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=foo CALL .intArrayOf type=kotlin.IntArray operator=null elements: VARARG type=IntArray varargElementType=Int CONST Int type=kotlin.Int value='1' @@ -9,7 +9,7 @@ FILE /arrayAugmentedAssignment1.kt CONST Int type=kotlin.Int value='3' FUN public fun bar(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=bar CONST Int type=kotlin.Int value='42' CLASS CLASS C FUN public constructor C(/*0*/ x: kotlin.IntArray) diff --git a/compiler/testData/ir/irText/expressions/booleanOperators.txt b/compiler/testData/ir/irText/expressions/booleanOperators.txt index 95c8d192970..2a89ae82c0d 100644 --- a/compiler/testData/ir/irText/expressions/booleanOperators.txt +++ b/compiler/testData/ir/irText/expressions/booleanOperators.txt @@ -1,27 +1,27 @@ FILE /booleanOperators.kt FUN public fun test1(/*0*/ a: kotlin.Boolean, /*1*/ b: kotlin.Boolean): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 WHEN type=kotlin.Boolean operator=ANDAND if: GET_VAR a type=kotlin.Boolean operator=null then: GET_VAR b type=kotlin.Boolean operator=null else: CONST Boolean type=kotlin.Boolean value='false' FUN public fun test2(/*0*/ a: kotlin.Boolean, /*1*/ b: kotlin.Boolean): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 WHEN type=kotlin.Boolean operator=OROR if: GET_VAR a type=kotlin.Boolean operator=null then: CONST Boolean type=kotlin.Boolean value='true' else: GET_VAR b type=kotlin.Boolean operator=null FUN public fun test1x(/*0*/ a: kotlin.Boolean, /*1*/ b: kotlin.Boolean): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1x CALL .and type=kotlin.Boolean operator=null $this: GET_VAR a type=kotlin.Boolean operator=null other: GET_VAR b type=kotlin.Boolean operator=null FUN public fun test2x(/*0*/ a: kotlin.Boolean, /*1*/ b: kotlin.Boolean): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2x CALL .or type=kotlin.Boolean operator=null $this: GET_VAR a type=kotlin.Boolean operator=null other: GET_VAR b type=kotlin.Boolean operator=null diff --git a/compiler/testData/ir/irText/expressions/boxOk.txt b/compiler/testData/ir/irText/expressions/boxOk.txt index a91c03e24a2..779a0dec3fc 100644 --- a/compiler/testData/ir/irText/expressions/boxOk.txt +++ b/compiler/testData/ir/irText/expressions/boxOk.txt @@ -1,5 +1,5 @@ FILE /boxOk.kt FUN public fun box(): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=box CONST String type=kotlin.String value='OK' diff --git a/compiler/testData/ir/irText/expressions/callWithReorderedArguments.txt b/compiler/testData/ir/irText/expressions/callWithReorderedArguments.txt index af7e716b6c9..4fa28a95f6c 100644 --- a/compiler/testData/ir/irText/expressions/callWithReorderedArguments.txt +++ b/compiler/testData/ir/irText/expressions/callWithReorderedArguments.txt @@ -3,19 +3,19 @@ FILE /callWithReorderedArguments.kt BLOCK_BODY FUN public fun noReorder1(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=noReorder1 CONST Int type=kotlin.Int value='1' FUN public fun noReorder2(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=noReorder2 CONST Int type=kotlin.Int value='2' FUN public fun reordered1(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=reordered1 CONST Int type=kotlin.Int value='1' FUN public fun reordered2(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=reordered2 CONST Int type=kotlin.Int value='2' FUN public fun test(): kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/calls.txt b/compiler/testData/ir/irText/expressions/calls.txt index fac4118cdf4..54f3c860a87 100644 --- a/compiler/testData/ir/irText/expressions/calls.txt +++ b/compiler/testData/ir/irText/expressions/calls.txt @@ -1,17 +1,17 @@ FILE /calls.kt FUN public fun foo(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=foo GET_VAR x type=kotlin.Int operator=null FUN public fun bar(/*0*/ x: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=bar CALL .foo type=kotlin.Int operator=null x: GET_VAR x type=kotlin.Int operator=null y: CONST Int type=kotlin.Int value='1' FUN public fun qux(/*0*/ x: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=qux CALL .foo type=kotlin.Int operator=null x: CALL .foo type=kotlin.Int operator=null x: GET_VAR x type=kotlin.Int operator=null @@ -19,17 +19,17 @@ FILE /calls.kt y: GET_VAR x type=kotlin.Int operator=null FUN public fun kotlin.Int.ext1(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=ext1 $RECEIVER of: ext1 type=kotlin.Int FUN public fun kotlin.Int.ext2(/*0*/ x: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=ext2 CALL .foo type=kotlin.Int operator=null x: $RECEIVER of: ext2 type=kotlin.Int y: GET_VAR x type=kotlin.Int operator=null FUN public fun kotlin.Int.ext3(/*0*/ x: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=ext3 CALL .foo type=kotlin.Int operator=null x: CALL .ext1 type=kotlin.Int operator=null $receiver: $RECEIVER of: ext3 type=kotlin.Int diff --git a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt index 7ecfc4ccf72..6d8132a35b4 100644 --- a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt +++ b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt @@ -2,15 +2,15 @@ FILE /chainOfSafeCalls.kt CLASS CLASS C FUN public final fun foo(): C BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=foo THIS public final class C type=C FUN public final fun bar(): C? BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=bar THIS public final class C type=C FUN public fun test(/*0*/ nc: C?): C? BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test BLOCK type=C? operator=SAFE_CALL VAR val tmp2_safe_receiver: C? WHEN type=C? operator=SAFE_CALL diff --git a/compiler/testData/ir/irText/expressions/conventionComparisons.txt b/compiler/testData/ir/irText/expressions/conventionComparisons.txt index 99bed0bca10..d33086be882 100644 --- a/compiler/testData/ir/irText/expressions/conventionComparisons.txt +++ b/compiler/testData/ir/irText/expressions/conventionComparisons.txt @@ -4,7 +4,7 @@ FILE /conventionComparisons.kt FUN public abstract operator fun IA.compareTo(/*0*/ other: IA): kotlin.Int FUN public fun IB.test1(/*0*/ a1: IA, /*1*/ a2: IA): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT $this: $RECEIVER of: test1 type=IB @@ -12,7 +12,7 @@ FILE /conventionComparisons.kt other: GET_VAR a2 type=IA operator=null FUN public fun IB.test2(/*0*/ a1: IA, /*1*/ a2: IA): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ arg0: CALL .compareTo type=kotlin.Int operator=GTEQ $this: $RECEIVER of: test2 type=IB @@ -20,7 +20,7 @@ FILE /conventionComparisons.kt other: GET_VAR a2 type=IA operator=null FUN public fun IB.test3(/*0*/ a1: IA, /*1*/ a2: IA): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 CALL .LT0 type=kotlin.Boolean operator=LT arg0: CALL .compareTo type=kotlin.Int operator=LT $this: $RECEIVER of: test3 type=IB @@ -28,7 +28,7 @@ FILE /conventionComparisons.kt other: GET_VAR a2 type=IA operator=null FUN public fun IB.test4(/*0*/ a1: IA, /*1*/ a2: IA): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test4 CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ arg0: CALL .compareTo type=kotlin.Int operator=LTEQ $this: $RECEIVER of: test4 type=IB diff --git a/compiler/testData/ir/irText/expressions/dotQualified.txt b/compiler/testData/ir/irText/expressions/dotQualified.txt index 36969013325..2d5329a2033 100644 --- a/compiler/testData/ir/irText/expressions/dotQualified.txt +++ b/compiler/testData/ir/irText/expressions/dotQualified.txt @@ -1,12 +1,12 @@ FILE /dotQualified.kt FUN public fun length(/*0*/ s: kotlin.String): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=length CALL . type=kotlin.Int operator=GET_PROPERTY $this: GET_VAR s type=kotlin.String operator=null FUN public fun lengthN(/*0*/ s: kotlin.String?): kotlin.Int? BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=lengthN WHEN type=kotlin.Int? operator=SAFE_CALL if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: GET_VAR s type=kotlin.String? operator=null diff --git a/compiler/testData/ir/irText/expressions/elvis.txt b/compiler/testData/ir/irText/expressions/elvis.txt index 8a77670561c..14522aee904 100644 --- a/compiler/testData/ir/irText/expressions/elvis.txt +++ b/compiler/testData/ir/irText/expressions/elvis.txt @@ -4,11 +4,11 @@ FILE /elvis.kt CONST Null type=kotlin.Nothing? value='null' FUN public fun foo(): kotlin.Any? BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=foo CONST Null type=kotlin.Nothing? value='null' FUN public fun test1(/*0*/ a: kotlin.Any?, /*1*/ b: kotlin.Any): kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 BLOCK type=kotlin.Any operator=ELVIS WHEN type=kotlin.Any operator=null if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ @@ -18,7 +18,7 @@ FILE /elvis.kt else: GET_VAR a type=kotlin.Any? operator=null FUN public fun test2(/*0*/ a: kotlin.String?, /*1*/ b: kotlin.Any): kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 BLOCK type=kotlin.Any operator=ELVIS WHEN type=kotlin.Any operator=null if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ @@ -31,14 +31,14 @@ FILE /elvis.kt WHEN type=kotlin.Unit operator=IF if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String GET_VAR b type=kotlin.Any? operator=null - then: RETURN type=kotlin.Nothing + then: RETURN type=kotlin.Nothing from=test3 CONST String type=kotlin.String value='' WHEN type=kotlin.Unit operator=IF if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String? GET_VAR a type=kotlin.Any? operator=null - then: RETURN type=kotlin.Nothing + then: RETURN type=kotlin.Nothing from=test3 CONST String type=kotlin.String value='' - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 BLOCK type=kotlin.String operator=ELVIS WHEN type=kotlin.String operator=null if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ @@ -50,7 +50,7 @@ FILE /elvis.kt GET_VAR a type=kotlin.Any? operator=null FUN public fun test4(/*0*/ x: kotlin.Any): kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test4 BLOCK type=kotlin.Any operator=ELVIS VAR val tmp0_elvis_lhs: kotlin.Any? CALL . type=kotlin.Any? operator=GET_PROPERTY @@ -62,7 +62,7 @@ FILE /elvis.kt else: GET_VAR tmp0_elvis_lhs type=kotlin.Any? operator=null FUN public fun test5(/*0*/ x: kotlin.Any): kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test5 BLOCK type=kotlin.Any operator=ELVIS VAR val tmp0_elvis_lhs: kotlin.Any? CALL .foo type=kotlin.Any? operator=null diff --git a/compiler/testData/ir/irText/expressions/equality.txt b/compiler/testData/ir/irText/expressions/equality.txt index 48c609da03b..2e76e8fe23c 100644 --- a/compiler/testData/ir/irText/expressions/equality.txt +++ b/compiler/testData/ir/irText/expressions/equality.txt @@ -1,20 +1,20 @@ FILE /equality.kt FUN public fun test1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: GET_VAR a type=kotlin.Int operator=null arg1: GET_VAR b type=kotlin.Int operator=null FUN public fun test2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 CALL .NOT type=kotlin.Boolean operator=EXCLEQ arg0: CALL .EQEQ type=kotlin.Boolean operator=EXCLEQ arg0: GET_VAR a type=kotlin.Int operator=null arg1: GET_VAR b type=kotlin.Int operator=null FUN public fun test3(/*0*/ a: kotlin.Any?, /*1*/ b: kotlin.Any?): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: GET_VAR a type=kotlin.Any? operator=null arg1: GET_VAR b type=kotlin.Any? operator=null diff --git a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.txt b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.txt index 275646d0506..621582c268c 100644 --- a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.txt +++ b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.txt @@ -2,10 +2,10 @@ FILE /extensionPropertyGetterCall.kt PROPERTY public val kotlin.String.okext: kotlin.String getter= setter=null PROPERTY_GETTER public fun kotlin.String.(): kotlin.String property=okext BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= CONST String type=kotlin.String value='OK' FUN public fun kotlin.String.test5(): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test5 CALL . type=kotlin.String operator=GET_PROPERTY $receiver: $RECEIVER of: test5 type=kotlin.String diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt index a382b5ad9fb..5e40b56dcd3 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt @@ -10,12 +10,12 @@ FILE /forWithImplicitReceivers.kt CLASS INTERFACE IReceiver FUN public open operator fun FiveTimes.iterator(): IntCell BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=iterator CALL . type=IntCell operator=null value: CONST Int type=kotlin.Int value='5' FUN public open operator fun IntCell.hasNext(): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=hasNext CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT $this: CALL . type=kotlin.Int operator=GET_PROPERTY @@ -23,7 +23,7 @@ FILE /forWithImplicitReceivers.kt other: CONST Int type=kotlin.Int value='0' FUN public open operator fun IntCell.next(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=next BLOCK type=kotlin.Int operator=POSTFIX_DECR VAR val tmp0: kotlin.Int CALL . type=kotlin.Int operator=POSTFIX_DECR diff --git a/compiler/testData/ir/irText/expressions/identity.txt b/compiler/testData/ir/irText/expressions/identity.txt index 60540e93719..3e892379d4d 100644 --- a/compiler/testData/ir/irText/expressions/identity.txt +++ b/compiler/testData/ir/irText/expressions/identity.txt @@ -1,20 +1,20 @@ FILE /identity.kt FUN public fun test1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 CALL .EQEQEQ type=kotlin.Boolean operator=EQEQEQ arg0: GET_VAR a type=kotlin.Int operator=null arg1: GET_VAR b type=kotlin.Int operator=null FUN public fun test2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 CALL .NOT type=kotlin.Boolean operator=EXCLEQEQ arg0: CALL .EQEQEQ type=kotlin.Boolean operator=EXCLEQEQ arg0: GET_VAR a type=kotlin.Int operator=null arg1: GET_VAR b type=kotlin.Int operator=null FUN public fun test3(/*0*/ a: kotlin.Any?, /*1*/ b: kotlin.Any?): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 CALL .EQEQEQ type=kotlin.Boolean operator=EQEQEQ arg0: GET_VAR a type=kotlin.Any? operator=null arg1: GET_VAR b type=kotlin.Any? operator=null diff --git a/compiler/testData/ir/irText/expressions/ifElseIf.txt b/compiler/testData/ir/irText/expressions/ifElseIf.txt index c68fe40d11c..220ee5eb691 100644 --- a/compiler/testData/ir/irText/expressions/ifElseIf.txt +++ b/compiler/testData/ir/irText/expressions/ifElseIf.txt @@ -1,7 +1,7 @@ FILE /ifElseIf.kt FUN public fun test(/*0*/ i: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test WHEN type=kotlin.Int operator=WHEN if: CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT diff --git a/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.txt b/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.txt index be73813d959..b300a4d6b68 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.txt @@ -1,7 +1,7 @@ FILE /implicitCastOnPlatformType.kt FUN public fun test(): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=kotlin.String CALL .getProperty type=kotlin.String! operator=null p0: CONST String type=kotlin.String value='test' diff --git a/compiler/testData/ir/irText/expressions/in.txt b/compiler/testData/ir/irText/expressions/in.txt index 57a5eceaaea..e42d7e63d63 100644 --- a/compiler/testData/ir/irText/expressions/in.txt +++ b/compiler/testData/ir/irText/expressions/in.txt @@ -1,26 +1,26 @@ FILE /in.kt FUN public fun test1(/*0*/ a: kotlin.Any, /*1*/ x: kotlin.collections.Collection): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 CALL .contains type=kotlin.Boolean operator=IN $this: GET_VAR x type=kotlin.collections.Collection operator=null element: GET_VAR a type=kotlin.Any operator=null FUN public fun test2(/*0*/ a: kotlin.Any, /*1*/ x: kotlin.collections.Collection): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 CALL .NOT type=kotlin.Boolean operator=NOT_IN arg0: CALL .contains type=kotlin.Boolean operator=NOT_IN $this: GET_VAR x type=kotlin.collections.Collection operator=null element: GET_VAR a type=kotlin.Any operator=null FUN public fun test3(/*0*/ a: T, /*1*/ x: kotlin.collections.Collection): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 CALL .contains type=kotlin.Boolean operator=IN $this: GET_VAR x type=kotlin.collections.Collection operator=null element: GET_VAR a type=T operator=null FUN public fun test4(/*0*/ a: T, /*1*/ x: kotlin.collections.Collection): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test4 CALL .NOT type=kotlin.Boolean operator=NOT_IN arg0: CALL .contains type=kotlin.Boolean operator=NOT_IN $this: GET_VAR x type=kotlin.collections.Collection operator=null diff --git a/compiler/testData/ir/irText/expressions/primitiveComparisons.txt b/compiler/testData/ir/irText/expressions/primitiveComparisons.txt index 68b01b1585a..d62f1632eac 100644 --- a/compiler/testData/ir/irText/expressions/primitiveComparisons.txt +++ b/compiler/testData/ir/irText/expressions/primitiveComparisons.txt @@ -1,168 +1,168 @@ FILE /primitiveComparisons.kt FUN public fun btest1(/*0*/ a: kotlin.Byte, /*1*/ b: kotlin.Byte): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=btest1 CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT $this: GET_VAR a type=kotlin.Byte operator=null other: GET_VAR b type=kotlin.Byte operator=null FUN public fun btest2(/*0*/ a: kotlin.Byte, /*1*/ b: kotlin.Byte): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=btest2 CALL .LT0 type=kotlin.Boolean operator=LT arg0: CALL .compareTo type=kotlin.Int operator=LT $this: GET_VAR a type=kotlin.Byte operator=null other: GET_VAR b type=kotlin.Byte operator=null FUN public fun btest3(/*0*/ a: kotlin.Byte, /*1*/ b: kotlin.Byte): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=btest3 CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ arg0: CALL .compareTo type=kotlin.Int operator=GTEQ $this: GET_VAR a type=kotlin.Byte operator=null other: GET_VAR b type=kotlin.Byte operator=null FUN public fun btest4(/*0*/ a: kotlin.Byte, /*1*/ b: kotlin.Byte): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=btest4 CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ arg0: CALL .compareTo type=kotlin.Int operator=LTEQ $this: GET_VAR a type=kotlin.Byte operator=null other: GET_VAR b type=kotlin.Byte operator=null FUN public fun stest1(/*0*/ a: kotlin.Short, /*1*/ b: kotlin.Short): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=stest1 CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT $this: GET_VAR a type=kotlin.Short operator=null other: GET_VAR b type=kotlin.Short operator=null FUN public fun stest2(/*0*/ a: kotlin.Short, /*1*/ b: kotlin.Short): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=stest2 CALL .LT0 type=kotlin.Boolean operator=LT arg0: CALL .compareTo type=kotlin.Int operator=LT $this: GET_VAR a type=kotlin.Short operator=null other: GET_VAR b type=kotlin.Short operator=null FUN public fun stest3(/*0*/ a: kotlin.Short, /*1*/ b: kotlin.Short): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=stest3 CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ arg0: CALL .compareTo type=kotlin.Int operator=GTEQ $this: GET_VAR a type=kotlin.Short operator=null other: GET_VAR b type=kotlin.Short operator=null FUN public fun stest4(/*0*/ a: kotlin.Short, /*1*/ b: kotlin.Short): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=stest4 CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ arg0: CALL .compareTo type=kotlin.Int operator=LTEQ $this: GET_VAR a type=kotlin.Short operator=null other: GET_VAR b type=kotlin.Short operator=null FUN public fun itest1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=itest1 CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun itest2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=itest2 CALL .LT0 type=kotlin.Boolean operator=LT arg0: CALL .compareTo type=kotlin.Int operator=LT $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun itest3(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=itest3 CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ arg0: CALL .compareTo type=kotlin.Int operator=GTEQ $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun itest4(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=itest4 CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ arg0: CALL .compareTo type=kotlin.Int operator=LTEQ $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun ltest1(/*0*/ a: kotlin.Long, /*1*/ b: kotlin.Long): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=ltest1 CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT $this: GET_VAR a type=kotlin.Long operator=null other: GET_VAR b type=kotlin.Long operator=null FUN public fun ltest2(/*0*/ a: kotlin.Long, /*1*/ b: kotlin.Long): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=ltest2 CALL .LT0 type=kotlin.Boolean operator=LT arg0: CALL .compareTo type=kotlin.Int operator=LT $this: GET_VAR a type=kotlin.Long operator=null other: GET_VAR b type=kotlin.Long operator=null FUN public fun ltest3(/*0*/ a: kotlin.Long, /*1*/ b: kotlin.Long): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=ltest3 CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ arg0: CALL .compareTo type=kotlin.Int operator=GTEQ $this: GET_VAR a type=kotlin.Long operator=null other: GET_VAR b type=kotlin.Long operator=null FUN public fun ltest4(/*0*/ a: kotlin.Long, /*1*/ b: kotlin.Long): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=ltest4 CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ arg0: CALL .compareTo type=kotlin.Int operator=LTEQ $this: GET_VAR a type=kotlin.Long operator=null other: GET_VAR b type=kotlin.Long operator=null FUN public fun ftest1(/*0*/ a: kotlin.Float, /*1*/ b: kotlin.Float): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=ftest1 CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT $this: GET_VAR a type=kotlin.Float operator=null other: GET_VAR b type=kotlin.Float operator=null FUN public fun ftest2(/*0*/ a: kotlin.Float, /*1*/ b: kotlin.Float): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=ftest2 CALL .LT0 type=kotlin.Boolean operator=LT arg0: CALL .compareTo type=kotlin.Int operator=LT $this: GET_VAR a type=kotlin.Float operator=null other: GET_VAR b type=kotlin.Float operator=null FUN public fun ftest3(/*0*/ a: kotlin.Float, /*1*/ b: kotlin.Float): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=ftest3 CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ arg0: CALL .compareTo type=kotlin.Int operator=GTEQ $this: GET_VAR a type=kotlin.Float operator=null other: GET_VAR b type=kotlin.Float operator=null FUN public fun ftest4(/*0*/ a: kotlin.Float, /*1*/ b: kotlin.Float): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=ftest4 CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ arg0: CALL .compareTo type=kotlin.Int operator=LTEQ $this: GET_VAR a type=kotlin.Float operator=null other: GET_VAR b type=kotlin.Float operator=null FUN public fun dtest1(/*0*/ a: kotlin.Double, /*1*/ b: kotlin.Double): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=dtest1 CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT $this: GET_VAR a type=kotlin.Double operator=null other: GET_VAR b type=kotlin.Double operator=null FUN public fun dtest2(/*0*/ a: kotlin.Double, /*1*/ b: kotlin.Double): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=dtest2 CALL .LT0 type=kotlin.Boolean operator=LT arg0: CALL .compareTo type=kotlin.Int operator=LT $this: GET_VAR a type=kotlin.Double operator=null other: GET_VAR b type=kotlin.Double operator=null FUN public fun dtest3(/*0*/ a: kotlin.Double, /*1*/ b: kotlin.Double): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=dtest3 CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ arg0: CALL .compareTo type=kotlin.Int operator=GTEQ $this: GET_VAR a type=kotlin.Double operator=null other: GET_VAR b type=kotlin.Double operator=null FUN public fun dtest4(/*0*/ a: kotlin.Double, /*1*/ b: kotlin.Double): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=dtest4 CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ arg0: CALL .compareTo type=kotlin.Int operator=LTEQ $this: GET_VAR a type=kotlin.Double operator=null diff --git a/compiler/testData/ir/irText/expressions/references.txt b/compiler/testData/ir/irText/expressions/references.txt index 87fd4af4c04..87320937381 100644 --- a/compiler/testData/ir/irText/expressions/references.txt +++ b/compiler/testData/ir/irText/expressions/references.txt @@ -8,33 +8,33 @@ FILE /references.kt PROPERTY public val ok3: kotlin.String getter= setter=null PROPERTY_GETTER public fun (): kotlin.String property=ok3 BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= CONST String type=kotlin.String value='OK' FUN public fun test1(): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 CALL . type=kotlin.String operator=GET_PROPERTY FUN public fun test2(/*0*/ x: kotlin.String): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 GET_VAR x type=kotlin.String operator=null FUN public fun test3(): kotlin.String BLOCK_BODY VAR val x: kotlin.String = "OK" CONST String type=kotlin.String value='OK' - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 GET_VAR x type=kotlin.String operator=null FUN public fun test4(): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test4 CALL . type=kotlin.String operator=GET_PROPERTY PROPERTY public val kotlin.String.okext: kotlin.String getter= setter=null PROPERTY_GETTER public fun kotlin.String.(): kotlin.String property=okext BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= CONST String type=kotlin.String value='OK' FUN public fun kotlin.String.test5(): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test5 CALL . type=kotlin.String operator=GET_PROPERTY $receiver: $RECEIVER of: test5 type=kotlin.String diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt index 95a276f4831..1b17cf7b31d 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt @@ -3,13 +3,13 @@ FILE /safeCallWithIncrementDecrement.kt PROPERTY public var test.C?.p: kotlin.Int getter= setter= PROPERTY_GETTER public fun test.C?.(): kotlin.Int property=p BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= CONST Int type=kotlin.Int value='42' PROPERTY_SETTER public fun test.C?.(/*0*/ value: kotlin.Int): kotlin.Unit property=p BLOCK_BODY FUN public operator fun kotlin.Int?.inc(): kotlin.Int? BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=inc WHEN type=kotlin.Int? operator=SAFE_CALL if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: $RECEIVER of: inc type=kotlin.Int? @@ -19,7 +19,7 @@ FILE /safeCallWithIncrementDecrement.kt $this: $RECEIVER of: inc type=kotlin.Int? FUN public operator fun kotlin.Int?.get(/*0*/ index: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=get CONST Int type=kotlin.Int value='42' FUN public operator fun kotlin.Int?.set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Int): kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/safeCalls.txt b/compiler/testData/ir/irText/expressions/safeCalls.txt index 85b917b79f9..73a51bc7ae8 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.txt @@ -9,12 +9,12 @@ FILE /safeCalls.kt CLASS INTERFACE IHost FUN public open fun kotlin.String.extLength(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=extLength CALL . type=kotlin.Int operator=GET_PROPERTY $this: $RECEIVER of: extLength type=kotlin.String FUN public fun test1(/*0*/ x: kotlin.String?): kotlin.Int? BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 WHEN type=kotlin.Int? operator=SAFE_CALL if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: GET_VAR x type=kotlin.String? operator=null @@ -24,7 +24,7 @@ FILE /safeCalls.kt $this: GET_VAR x type=kotlin.String? operator=null FUN public fun test2(/*0*/ x: kotlin.String?): kotlin.Int? BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 WHEN type=kotlin.Int? operator=SAFE_CALL if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: GET_VAR x type=kotlin.String? operator=null @@ -34,7 +34,7 @@ FILE /safeCalls.kt $this: GET_VAR x type=kotlin.String? operator=null FUN public fun test3(/*0*/ x: kotlin.String?, /*1*/ y: kotlin.Any?): kotlin.Boolean? BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 WHEN type=kotlin.Boolean? operator=SAFE_CALL if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: GET_VAR x type=kotlin.String? operator=null @@ -55,7 +55,7 @@ FILE /safeCalls.kt : CONST Int type=kotlin.Int value='0' FUN public fun IHost.test5(/*0*/ s: kotlin.String?): kotlin.Int? BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test5 WHEN type=kotlin.Int? operator=SAFE_CALL if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: GET_VAR s type=kotlin.String? operator=null diff --git a/compiler/testData/ir/irText/expressions/simpleOperators.txt b/compiler/testData/ir/irText/expressions/simpleOperators.txt index f318f07b232..0de1301fbd6 100644 --- a/compiler/testData/ir/irText/expressions/simpleOperators.txt +++ b/compiler/testData/ir/irText/expressions/simpleOperators.txt @@ -1,67 +1,67 @@ FILE /simpleOperators.kt FUN public fun test1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 CALL .plus type=kotlin.Int operator=PLUS $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun test2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 CALL .minus type=kotlin.Int operator=MINUS $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun test3(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 CALL .times type=kotlin.Int operator=MUL $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun test4(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test4 CALL .div type=kotlin.Int operator=DIV $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun test5(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test5 CALL .mod type=kotlin.Int operator=PERC $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun test6(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.ranges.IntRange BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test6 CALL .rangeTo type=kotlin.ranges.IntRange operator=RANGE $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun test1x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1x CALL .plus type=kotlin.Int operator=null $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun test2x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2x CALL .minus type=kotlin.Int operator=null $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun test3x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3x CALL .times type=kotlin.Int operator=null $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun test4x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test4x CALL .div type=kotlin.Int operator=null $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null FUN public fun test5x(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test5x CALL .mod type=kotlin.Int operator=null $this: GET_VAR a type=kotlin.Int operator=null other: GET_VAR b type=kotlin.Int operator=null diff --git a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.txt b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.txt index 4fdbc9e609e..b0919f86471 100644 --- a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.txt +++ b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.txt @@ -1,31 +1,31 @@ FILE /simpleUnaryOperators.kt FUN public fun test1(/*0*/ x: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 CALL .unaryMinus type=kotlin.Int operator=UMINUS $this: GET_VAR x type=kotlin.Int operator=null FUN public fun test2(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 CALL .unaryMinus type=kotlin.Int operator=UMINUS $this: CONST Int type=kotlin.Int value='42' FUN public fun test3(/*0*/ x: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 CALL .unaryPlus type=kotlin.Int operator=UPLUS $this: GET_VAR x type=kotlin.Int operator=null FUN public fun test4(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test4 CALL .unaryPlus type=kotlin.Int operator=UPLUS $this: CONST Int type=kotlin.Int value='42' FUN public fun test5(/*0*/ x: kotlin.Boolean): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test5 CALL .not type=kotlin.Boolean operator=EXCL $this: GET_VAR x type=kotlin.Boolean operator=null FUN public fun test6(): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test6 CALL .not type=kotlin.Boolean operator=EXCL $this: CONST Boolean type=kotlin.Boolean value='true' diff --git a/compiler/testData/ir/irText/expressions/smartCasts.txt b/compiler/testData/ir/irText/expressions/smartCasts.txt index 3b12758c939..500208e3cec 100644 --- a/compiler/testData/ir/irText/expressions/smartCasts.txt +++ b/compiler/testData/ir/irText/expressions/smartCasts.txt @@ -5,18 +5,18 @@ FILE /smartCasts.kt BLOCK_BODY FUN public fun overloaded(/*0*/ s: kotlin.String): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=overloaded GET_VAR s type=kotlin.String operator=null FUN public fun overloaded(/*0*/ x: kotlin.Any): kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=overloaded GET_VAR x type=kotlin.Any operator=null FUN public fun test1(/*0*/ x: kotlin.Any): kotlin.Unit BLOCK_BODY WHEN type=kotlin.Unit operator=IF if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String GET_VAR x type=kotlin.Any operator=null - then: RETURN type=kotlin.Nothing + then: RETURN type=kotlin.Nothing from=test1 CALL .println type=kotlin.Unit operator=null message: CALL . type=kotlin.Int operator=GET_PROPERTY $this: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String @@ -37,9 +37,9 @@ FILE /smartCasts.kt WHEN type=kotlin.Unit operator=IF if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String GET_VAR x type=kotlin.Any operator=null - then: RETURN type=kotlin.Nothing + then: RETURN type=kotlin.Nothing from=test2 CONST String type=kotlin.String value='' - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 CALL .overloaded type=kotlin.String operator=null s: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String GET_VAR x type=kotlin.Any operator=null @@ -48,8 +48,8 @@ FILE /smartCasts.kt WHEN type=kotlin.Unit operator=IF if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String GET_VAR x type=kotlin.Any operator=null - then: RETURN type=kotlin.Nothing + then: RETURN type=kotlin.Nothing from=test3 CONST String type=kotlin.String value='' - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String GET_VAR x type=kotlin.Any operator=null diff --git a/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.txt b/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.txt index 810fa7f8ef0..f6b01ae6f3e 100644 --- a/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.txt +++ b/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.txt @@ -3,18 +3,18 @@ FILE /smartCastsWithDestructuring.kt CLASS INTERFACE I2 FUN public operator fun I1.component1(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=component1 CONST Int type=kotlin.Int value='1' FUN public operator fun I2.component2(): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=component2 CONST String type=kotlin.String value='' FUN public fun test(/*0*/ x: I1): kotlin.Unit BLOCK_BODY WHEN type=kotlin.Unit operator=IF if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=I2 GET_VAR x type=I1 operator=null - then: RETURN type=kotlin.Nothing + then: RETURN type=kotlin.Nothing from=test BLOCK type=kotlin.Unit operator=DESTRUCTURING_DECLARATION VAR val c1: kotlin.Int CALL .component1 type=kotlin.Int operator=COMPONENT_N(index=1) diff --git a/compiler/testData/ir/irText/expressions/smoke.txt b/compiler/testData/ir/irText/expressions/smoke.txt index b3e940f5678..0df61010155 100644 --- a/compiler/testData/ir/irText/expressions/smoke.txt +++ b/compiler/testData/ir/irText/expressions/smoke.txt @@ -1,7 +1,7 @@ FILE /smoke.kt FUN public fun testFun(): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=testFun CONST String type=kotlin.String value='OK' PROPERTY public val testSimpleVal: kotlin.Int = 1 getter=null setter=null EXPRESSION_BODY @@ -9,7 +9,7 @@ FILE /smoke.kt PROPERTY public val testValWithGetter: kotlin.Int getter= setter=null PROPERTY_GETTER public fun (): kotlin.Int property=testValWithGetter BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= CONST Int type=kotlin.Int value='42' PROPERTY public var testSimpleVar: kotlin.Int getter=null setter=null EXPRESSION_BODY @@ -17,7 +17,7 @@ FILE /smoke.kt PROPERTY public var testVarWithAccessors: kotlin.Int getter= setter= PROPERTY_GETTER public fun (): kotlin.Int property=testVarWithAccessors BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= CONST Int type=kotlin.Int value='42' PROPERTY_SETTER public fun (/*0*/ v: kotlin.Int): kotlin.Unit property=testVarWithAccessors BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/stringComparisons.txt b/compiler/testData/ir/irText/expressions/stringComparisons.txt index 41a5a607fd8..6e1bd6ff7f2 100644 --- a/compiler/testData/ir/irText/expressions/stringComparisons.txt +++ b/compiler/testData/ir/irText/expressions/stringComparisons.txt @@ -1,28 +1,28 @@ FILE /stringComparisons.kt FUN public fun test1(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT $this: GET_VAR a type=kotlin.String operator=null other: GET_VAR b type=kotlin.String operator=null FUN public fun test2(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 CALL .LT0 type=kotlin.Boolean operator=LT arg0: CALL .compareTo type=kotlin.Int operator=LT $this: GET_VAR a type=kotlin.String operator=null other: GET_VAR b type=kotlin.String operator=null FUN public fun test3(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ arg0: CALL .compareTo type=kotlin.Int operator=GTEQ $this: GET_VAR a type=kotlin.String operator=null other: GET_VAR b type=kotlin.String operator=null FUN public fun test4(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test4 CALL .LTEQ0 type=kotlin.Boolean operator=LTEQ arg0: CALL .compareTo type=kotlin.Int operator=LTEQ $this: GET_VAR a type=kotlin.String operator=null diff --git a/compiler/testData/ir/irText/expressions/stringPlus.txt b/compiler/testData/ir/irText/expressions/stringPlus.txt index 23742252185..2670ff3bf2e 100644 --- a/compiler/testData/ir/irText/expressions/stringPlus.txt +++ b/compiler/testData/ir/irText/expressions/stringPlus.txt @@ -1,20 +1,20 @@ FILE /stringPlus.kt FUN public fun test1(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Any): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 STRING_CONCATENATION type=kotlin.String GET_VAR a type=kotlin.String operator=null GET_VAR b type=kotlin.Any operator=null FUN public fun test2(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 STRING_CONCATENATION type=kotlin.String GET_VAR a type=kotlin.String operator=null CONST String type=kotlin.String value='+' GET_VAR b type=kotlin.Int operator=null FUN public fun test3(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 STRING_CONCATENATION type=kotlin.String GET_VAR a type=kotlin.String operator=null CONST String type=kotlin.String value='+' diff --git a/compiler/testData/ir/irText/expressions/tryCatch.txt b/compiler/testData/ir/irText/expressions/tryCatch.txt index b01a6b2983d..3728344d651 100644 --- a/compiler/testData/ir/irText/expressions/tryCatch.txt +++ b/compiler/testData/ir/irText/expressions/tryCatch.txt @@ -10,7 +10,7 @@ FILE /tryCatch.kt CALL .println type=kotlin.Unit operator=null FUN public fun test2(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 TRY_CATCH type=kotlin.Int try: BLOCK type=kotlin.Int operator=null CALL .println type=kotlin.Unit operator=null diff --git a/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.txt b/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.txt index 1b8930e9f70..cffd9212691 100644 --- a/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.txt +++ b/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.txt @@ -4,7 +4,7 @@ FILE /tryCatchWithImplicitCast.kt WHEN type=kotlin.Unit operator=IF if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.String GET_VAR a type=kotlin.Any operator=null - then: RETURN type=kotlin.Nothing + then: RETURN type=kotlin.Nothing from=testImplicitCast VAR val t: kotlin.String TRY_CATCH type=kotlin.String try: BLOCK type=kotlin.String operator=null diff --git a/compiler/testData/ir/irText/expressions/typeOperators.txt b/compiler/testData/ir/irText/expressions/typeOperators.txt index f828a1b84fa..781c27def56 100644 --- a/compiler/testData/ir/irText/expressions/typeOperators.txt +++ b/compiler/testData/ir/irText/expressions/typeOperators.txt @@ -2,21 +2,21 @@ FILE /typeOperators.kt CLASS INTERFACE IThing FUN public fun test1(/*0*/ x: kotlin.Any): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 TYPE_OP operator=INSTANCEOF typeOperand=IThing GET_VAR x type=kotlin.Any operator=null FUN public fun test2(/*0*/ x: kotlin.Any): kotlin.Boolean BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 TYPE_OP operator=NOT_INSTANCEOF typeOperand=IThing GET_VAR x type=kotlin.Any operator=null FUN public fun test3(/*0*/ x: kotlin.Any): IThing BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 TYPE_OP operator=CAST typeOperand=IThing GET_VAR x type=kotlin.Any operator=null FUN public fun test4(/*0*/ x: kotlin.Any): IThing? BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test4 TYPE_OP operator=SAFE_CAST typeOperand=IThing GET_VAR x type=kotlin.Any operator=null diff --git a/compiler/testData/ir/irText/expressions/values.txt b/compiler/testData/ir/irText/expressions/values.txt index 92beb48cf3a..05c0beff567 100644 --- a/compiler/testData/ir/irText/expressions/values.txt +++ b/compiler/testData/ir/irText/expressions/values.txt @@ -9,17 +9,17 @@ FILE /values.kt CLASS OBJECT Companion FUN public fun test1(): Enum BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 GET_ENUM_VALUE A type=Enum FUN public fun test2(): A BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 GET_OBJECT A type=A FUN public fun test3(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 CALL . type=kotlin.Int operator=GET_PROPERTY FUN public fun test4(): Z.Companion BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test4 GET_OBJECT Companion type=Z.Companion diff --git a/compiler/testData/ir/irText/expressions/varargWithImplicitCast.txt b/compiler/testData/ir/irText/expressions/varargWithImplicitCast.txt index cc10d25f245..15340dc74e2 100644 --- a/compiler/testData/ir/irText/expressions/varargWithImplicitCast.txt +++ b/compiler/testData/ir/irText/expressions/varargWithImplicitCast.txt @@ -4,9 +4,9 @@ FILE /varargWithImplicitCast.kt WHEN type=kotlin.Unit operator=IF if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.Int GET_VAR a type=kotlin.Any operator=null - then: RETURN type=kotlin.Nothing + then: RETURN type=kotlin.Nothing from=testScalar CALL .intArrayOf type=kotlin.IntArray operator=null - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=testScalar CALL .intArrayOf type=kotlin.IntArray operator=null elements: VARARG type=IntArray varargElementType=Int TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Int @@ -16,9 +16,9 @@ FILE /varargWithImplicitCast.kt WHEN type=kotlin.Unit operator=IF if: TYPE_OP operator=NOT_INSTANCEOF typeOperand=kotlin.IntArray GET_VAR a type=kotlin.Any operator=null - then: RETURN type=kotlin.Nothing + then: RETURN type=kotlin.Nothing from=testSpread CALL .intArrayOf type=kotlin.IntArray operator=null - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=testSpread CALL .intArrayOf type=kotlin.IntArray operator=null elements: VARARG type=IntArray varargElementType=Int SPREAD_ELEMENT diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.txt index 9fd58a066af..f68d25dd7e9 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.txt @@ -1,33 +1,33 @@ FILE /variableAsFunctionCall.kt FUN public fun kotlin.String.k(): () -> kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=k BLOCK type=() -> kotlin.String operator=LAMBDA FUN local final fun (): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= $RECEIVER of: k type=kotlin.String CALLABLE_REFERENCE local final fun (): kotlin.String type=() -> kotlin.String FUN public fun test1(/*0*/ f: () -> kotlin.Unit): kotlin.Unit BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 CALL .invoke type=kotlin.Unit operator=INVOKE $this: GET_VAR f type=() -> kotlin.Unit operator=VARIABLE_AS_FUNCTION FUN public fun test2(/*0*/ f: kotlin.String.() -> kotlin.Unit): kotlin.Unit BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test2 CALL .invoke type=kotlin.Unit operator=INVOKE $this: GET_VAR f type=kotlin.String.() -> kotlin.Unit operator=VARIABLE_AS_FUNCTION $receiver: CONST String type=kotlin.String value='hello' FUN public fun test3(): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test3 CALL .invoke type=kotlin.String operator=null $this: CALL .k type=() -> kotlin.String operator=null $receiver: CONST String type=kotlin.String value='hello' FUN public fun test4(/*0*/ ns: kotlin.String?): kotlin.String? BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test4 WHEN type=kotlin.String? operator=SAFE_CALL if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: GET_VAR ns type=kotlin.String? operator=null diff --git a/compiler/testData/ir/irText/expressions/when.txt b/compiler/testData/ir/irText/expressions/when.txt index 9ed9a6183d2..08622c451ad 100644 --- a/compiler/testData/ir/irText/expressions/when.txt +++ b/compiler/testData/ir/irText/expressions/when.txt @@ -2,7 +2,7 @@ FILE /when.kt CLASS OBJECT A FUN public fun testWithSubject(/*0*/ x: kotlin.Any?): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=testWithSubject BLOCK type=kotlin.String operator=WHEN VAR val tmp0_subject: kotlin.Any? GET_VAR x type=kotlin.Any? operator=null @@ -25,7 +25,7 @@ FILE /when.kt else: CONST String type=kotlin.String value='something' FUN public fun test(/*0*/ x: kotlin.Any?): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test WHEN type=kotlin.String operator=WHEN if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: GET_VAR x type=kotlin.Any? operator=null @@ -45,7 +45,7 @@ FILE /when.kt else: CONST String type=kotlin.String value='something' FUN public fun testComma(/*0*/ x: kotlin.Int): kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=testComma BLOCK type=kotlin.String operator=WHEN VAR val tmp0_subject: kotlin.Int GET_VAR x type=kotlin.Int operator=null diff --git a/compiler/testData/ir/irText/lambdas/extensionLambda.txt b/compiler/testData/ir/irText/lambdas/extensionLambda.txt index d9d07c53a3d..12970a641a9 100644 --- a/compiler/testData/ir/irText/lambdas/extensionLambda.txt +++ b/compiler/testData/ir/irText/lambdas/extensionLambda.txt @@ -1,13 +1,13 @@ FILE /extensionLambda.kt FUN public fun test1(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=test1 CALL .run type=kotlin.Int operator=null $receiver: CONST String type=kotlin.String value='42' block: BLOCK type=kotlin.String.() -> kotlin.Int operator=LAMBDA FUN local final fun kotlin.String.(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= CALL . type=kotlin.Int operator=GET_PROPERTY $this: $RECEIVER of: type=kotlin.String CALLABLE_REFERENCE local final fun kotlin.String.(): kotlin.Int type=kotlin.String.() -> kotlin.Int diff --git a/compiler/testData/ir/irText/lambdas/justLambda.txt b/compiler/testData/ir/irText/lambdas/justLambda.txt index cfc2a70ab88..b1bd148be8d 100644 --- a/compiler/testData/ir/irText/lambdas/justLambda.txt +++ b/compiler/testData/ir/irText/lambdas/justLambda.txt @@ -4,6 +4,6 @@ FILE /justLambda.kt BLOCK type=() -> kotlin.Int operator=LAMBDA FUN local final fun (): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= CONST Int type=kotlin.Int value='42' CALLABLE_REFERENCE local final fun (): kotlin.Int type=() -> kotlin.Int diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt index 4f6f7b7edb6..795c6a90e96 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt @@ -5,12 +5,12 @@ FILE /multipleImplicitReceivers.kt PROPERTY public open val A.foo: B getter= setter=null PROPERTY_GETTER public open fun A.(): B property=foo BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= GET_OBJECT B type=B CLASS INTERFACE IInvoke FUN public open operator fun B.invoke(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from=invoke CONST Int type=kotlin.Int value='42' FUN public fun test(/*0*/ fooImpl: IFoo, /*1*/ invokeImpl: IInvoke): kotlin.Unit BLOCK_BODY @@ -19,19 +19,19 @@ FILE /multipleImplicitReceivers.kt block: BLOCK type=A.() -> kotlin.Int operator=LAMBDA FUN local final fun A.(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= CALL .with type=kotlin.Int operator=null receiver: GET_VAR fooImpl type=IFoo operator=null block: BLOCK type=IFoo.() -> kotlin.Int operator=LAMBDA FUN local final fun IFoo.(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= CALL .with type=kotlin.Int operator=null receiver: GET_VAR invokeImpl type=IInvoke operator=null block: BLOCK type=IInvoke.() -> kotlin.Int operator=LAMBDA FUN local final fun IInvoke.(): kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing + RETURN type=kotlin.Nothing from= CALL .invoke type=kotlin.Int operator=INVOKE $this: $RECEIVER of: type=IInvoke $receiver: CALL . type=B operator=GET_PROPERTY diff --git a/compiler/testData/ir/irText/lambdas/nonLocalReturn.kt b/compiler/testData/ir/irText/lambdas/nonLocalReturn.kt new file mode 100644 index 00000000000..c3ca68a5efc --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/nonLocalReturn.kt @@ -0,0 +1,18 @@ +fun test0() { + run { + return + } +} + +fun test1() { + run { + return@run + } +} + +fun test2() { + run lambda@{ + return@lambda + } +} + diff --git a/compiler/testData/ir/irText/lambdas/nonLocalReturn.txt b/compiler/testData/ir/irText/lambdas/nonLocalReturn.txt new file mode 100644 index 00000000000..b58124cea2c --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/nonLocalReturn.txt @@ -0,0 +1,25 @@ +FILE /nonLocalReturn.kt + FUN public fun test0(): kotlin.Unit + BLOCK_BODY + CALL .run type=kotlin.Nothing operator=null + block: BLOCK type=() -> kotlin.Nothing operator=LAMBDA + FUN local final fun (): kotlin.Nothing + BLOCK_BODY + RETURN type=kotlin.Nothing from=test0 + CALLABLE_REFERENCE local final fun (): kotlin.Nothing type=() -> kotlin.Nothing + FUN public fun test1(): kotlin.Unit + BLOCK_BODY + CALL .run type=kotlin.Unit operator=null + block: BLOCK type=() -> kotlin.Unit operator=LAMBDA + FUN local final fun (): kotlin.Unit + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CALLABLE_REFERENCE local final fun (): kotlin.Unit type=() -> kotlin.Unit + FUN public fun test2(): kotlin.Unit + BLOCK_BODY + CALL .run type=kotlin.Unit operator=null + block: BLOCK type=() -> kotlin.Unit operator=LAMBDA + FUN local final fun (): kotlin.Unit + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CALLABLE_REFERENCE local final fun (): kotlin.Unit type=() -> kotlin.Unit diff --git a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java index 36df216f325..805d0f0fab2 100644 --- a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java @@ -402,5 +402,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.kt"); doTest(fileName); } + + @TestMetadata("nonLocalReturn.kt") + public void testNonLocalReturn() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/lambdas/nonLocalReturn.kt"); + doTest(fileName); + } } }