From 179a06672be18b125039358fb3314bfc10161392 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Thu, 25 Aug 2016 14:38:32 +0300 Subject: [PATCH] IrExpression.type is no longer nullable. Change expression typing contract. --- .../kotlin/psi2ir/generators/BodyGenerator.kt | 2 +- .../BranchingExpressionGenerator.kt | 5 +- .../kotlin/psi2ir/generators/CallGenerator.kt | 4 +- .../kotlin/psi2ir/generators/Generator.kt | 2 +- .../generators/LoopExpressionGenerator.kt | 10 ++-- .../kotlin/psi2ir/generators/Primitives.kt | 4 +- .../kotlin/psi2ir/generators/Scope.kt | 6 +-- .../psi2ir/generators/StatementGenerator.kt | 24 ++++++---- .../generators/TryCatchExpressionGenerator.kt | 2 +- .../ArrayAccessAssignmentReceiver.kt | 2 +- .../LValueWithGetterAndSetterCalls.kt | 3 +- .../psi2ir/intermediate/OnceCallValue.kt | 2 +- .../intermediate/OnceExpressionValue.kt | 2 +- .../intermediate/RematerializableValue.kt | 3 +- .../psi2ir/intermediate/SafeCallReceiver.kt | 2 +- .../intermediate/SimplePropertyLValue.kt | 3 +- .../intermediate/TransientReceiverValue.kt | 2 +- .../kotlin/psi2ir/intermediate/Values.kt | 2 +- .../psi2ir/intermediate/VariableLValue.kt | 6 ++- .../transformations/InlineSafeCallChains.kt | 2 +- .../transformations/InsertImplicitCasts.kt | 5 +- .../kotlin/ir/expressions/IrBlock.kt | 2 +- .../jetbrains/kotlin/ir/expressions/IrCall.kt | 5 +- .../kotlin/ir/expressions/IrConst.kt | 2 +- .../ir/expressions/IrDeclarationReference.kt | 8 ++-- .../ir/expressions/IrDummyExpression.kt | 2 +- .../kotlin/ir/expressions/IrExpression.kt | 6 +-- .../ir/expressions/IrGetExtensionReceiver.kt | 2 +- .../jetbrains/kotlin/ir/expressions/IrLoop.kt | 16 +++++-- .../expressions/IrMemberAccessExpression.kt | 2 +- .../kotlin/ir/expressions/IrPrimitiveCall.kt | 2 +- .../kotlin/ir/expressions/IrReturn.kt | 6 ++- .../ir/expressions/IrStringConcatenation.kt | 2 +- .../kotlin/ir/expressions/IrThisReference.kt | 2 +- .../kotlin/ir/expressions/IrThrow.kt | 14 +++++- .../kotlin/ir/expressions/IrTryCatch.kt | 2 +- .../ir/expressions/IrTypeOperatorCall.kt | 4 +- .../expressions/IrVariableAccessExpression.kt | 6 ++- .../jetbrains/kotlin/ir/expressions/IrWhen.kt | 6 +-- compiler/testData/ir/irText/arrayAccess.txt | 4 +- .../testData/ir/irText/arrayAssignment.txt | 2 +- .../ir/irText/arrayAugmentedAssignment1.txt | 4 +- compiler/testData/ir/irText/assignments.txt | 4 +- .../ir/irText/augmentedAssignment1.txt | 10 ++-- .../testData/ir/irText/booleanOperators.txt | 8 ++-- compiler/testData/ir/irText/boxOk.txt | 2 +- .../ir/irText/callWithReorderedArguments.txt | 8 ++-- compiler/testData/ir/irText/calls.txt | 12 ++--- .../testData/ir/irText/chainOfSafeCalls.txt | 2 +- .../ir/irText/conventionComparisons.txt | 8 ++-- compiler/testData/ir/irText/dotQualified.txt | 4 +- compiler/testData/ir/irText/elvis.txt | 16 +++---- compiler/testData/ir/irText/equality.txt | 6 +-- .../ir/irText/extensionPropertyGetterCall.txt | 4 +- compiler/testData/ir/irText/identity.txt | 6 +-- compiler/testData/ir/irText/ifElseIf.txt | 2 +- .../ir/irText/implicitCastOnPlatformType.txt | 2 +- compiler/testData/ir/irText/in.txt | 8 ++-- .../testData/ir/irText/incrementDecrement.txt | 8 ++-- .../ir/irText/primitiveComparisons.txt | 48 +++++++++---------- compiler/testData/ir/irText/references.txt | 14 +++--- .../irText/safeCallWithIncrementDecrement.txt | 6 +-- compiler/testData/ir/irText/safeCalls.txt | 8 ++-- .../testData/ir/irText/simpleOperators.txt | 22 ++++----- .../ir/irText/simpleUnaryOperators.txt | 12 ++--- compiler/testData/ir/irText/smartCasts.txt | 14 +++--- .../ir/irText/smartCastsWithDestructuring.txt | 6 +-- compiler/testData/ir/irText/smoke.txt | 6 +-- .../testData/ir/irText/stringComparisons.txt | 8 ++-- compiler/testData/ir/irText/stringPlus.txt | 6 +-- compiler/testData/ir/irText/throw.txt | 4 +- compiler/testData/ir/irText/tryCatch.txt | 2 +- .../ir/irText/tryCatchWithImplicitCast.txt | 2 +- compiler/testData/ir/irText/typeOperators.txt | 8 ++-- compiler/testData/ir/irText/values.txt | 8 ++-- .../ir/irText/variableAsFunctionCall.txt | 10 ++-- compiler/testData/ir/irText/when.txt | 6 +-- compiler/testData/ir/irText/whileDoWhile.txt | 8 ++-- 78 files changed, 262 insertions(+), 238 deletions(-) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt index 6ce68ea56dd..c304a89e0c9 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt @@ -41,7 +41,7 @@ class BodyGenerator(val scopeOwner: CallableDescriptor, override val context: Ge } else { val irBodyExpression = statementGenerator.generateExpression(ktBody) - val irReturn = IrReturnImpl(ktBody.startOffset, ktBody.endOffset, scopeOwner, irBodyExpression) + val irReturn = IrReturnImpl(ktBody.startOffset, ktBody.endOffset, context.builtIns.nothingType, scopeOwner, irBodyExpression) irBlockBody.addStatement(irReturn) } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BranchingExpressionGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BranchingExpressionGenerator.kt index 0ba31af587d..96b0fbaf894 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BranchingExpressionGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BranchingExpressionGenerator.kt @@ -25,14 +25,13 @@ import org.jetbrains.kotlin.psi2ir.defaultLoad import org.jetbrains.kotlin.psi2ir.deparenthesize import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.utils.SmartList -import java.lang.AssertionError class BranchingExpressionGenerator(val statementGenerator: StatementGenerator) : GeneratorWithScope { override val scope: Scope get() = statementGenerator.scope override val context: GeneratorContext get() = statementGenerator.context fun generateIfExpression(expression: KtIfExpression): IrExpression { - val resultType = getInferredTypeWithSmartcasts(expression) + val resultType = getInferredTypeWithSmartcastsOrFail(expression) var ktLastIf: KtIfExpression = expression val irBranches = SmartList>() @@ -75,7 +74,7 @@ class BranchingExpressionGenerator(val statementGenerator: StatementGenerator) : scope.createTemporaryVariable(statementGenerator.generateExpression(it), "subject") } - val resultType = getInferredTypeWithSmartcasts(expression) + val resultType = getInferredTypeWithSmartcastsOrFail(expression) val irWhen = IrWhenImpl(expression.startOffset, expression.endOffset, resultType, IrOperator.WHEN) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt index 5cc999c08e4..b5da8de4e2c 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt @@ -83,7 +83,7 @@ class CallGenerator( operator: IrOperator?, call: CallBuilder ): IrExpression { - val returnType = descriptor.returnType + val returnType = descriptor.returnType!! return call.callReceiver.call { dispatchReceiverValue, extensionReceiverValue -> val irCall = IrCallImpl(startOffset, endOffset, returnType, descriptor, operator, call.superQualifier) @@ -111,7 +111,7 @@ class CallGenerator( startOffset: Int, endOffset: Int, call: CallBuilder, - resultType: KotlinType? + resultType: KotlinType ): IrExpression { val resolvedCall = call.original diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Generator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Generator.kt index e3353ad72ff..fc8ba2704dc 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Generator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Generator.kt @@ -100,4 +100,4 @@ fun getReturnType(descriptor: CallableDescriptor): KotlinType { } fun Generator.createDummyExpression(ktExpression: KtExpression, description: String): IrDummyExpression = - IrDummyExpression(ktExpression.startOffset, ktExpression.endOffset, getInferredTypeWithSmartcasts(ktExpression), description) \ No newline at end of file + IrDummyExpression(ktExpression.startOffset, ktExpression.endOffset, getInferredTypeWithSmartcastsOrFail(ktExpression), description) \ No newline at end of file diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LoopExpressionGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LoopExpressionGenerator.kt index 221f660dee1..85a37313145 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LoopExpressionGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LoopExpressionGenerator.kt @@ -32,10 +32,14 @@ class LoopExpressionGenerator(val statementGenerator: StatementGenerator) : Gene override val context: GeneratorContext get() = statementGenerator.context fun generateWhileLoop(ktWhile: KtWhileExpression): IrExpression = - generateConditionalLoop(ktWhile, IrWhileLoopImpl(ktWhile.startOffset, ktWhile.endOffset, IrOperator.WHILE_LOOP)) + generateConditionalLoop(ktWhile, + IrWhileLoopImpl(ktWhile.startOffset, ktWhile.endOffset, + context.builtIns.unitType, IrOperator.WHILE_LOOP)) fun generateDoWhileLoop(ktDoWhile: KtDoWhileExpression): IrExpression = - generateConditionalLoop(ktDoWhile, IrDoWhileLoopImpl(ktDoWhile.startOffset, ktDoWhile.endOffset, IrOperator.DO_WHILE_LOOP)) + generateConditionalLoop(ktDoWhile, + IrDoWhileLoopImpl(ktDoWhile.startOffset, ktDoWhile.endOffset, + context.builtIns.unitType, IrOperator.DO_WHILE_LOOP)) private fun generateConditionalLoop(ktLoop: KtWhileExpressionBase, irLoop: IrLoopBase): IrLoop { statementGenerator.bodyGenerator.putLoop(ktLoop, irLoop) @@ -116,7 +120,7 @@ class LoopExpressionGenerator(val statementGenerator: StatementGenerator) : Gene val iteratorValue = VariableLValue(irIterator) irForBlock.addStatement(irIterator) - val irInnerWhile = IrWhileLoopImpl(ktFor.startOffset, ktFor.endOffset, IrOperator.FOR_LOOP_INNER_WHILE) + val irInnerWhile = IrWhileLoopImpl(ktFor.startOffset, ktFor.endOffset, context.builtIns.unitType, IrOperator.FOR_LOOP_INNER_WHILE) irInnerWhile.label = getLoopLabel(ktFor) statementGenerator.bodyGenerator.putLoop(ktFor, irInnerWhile) irForBlock.addStatement(irInnerWhile) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Primitives.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Primitives.kt index 5a5d088acac..b59a74f46d7 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Primitives.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Primitives.kt @@ -38,7 +38,7 @@ fun GeneratorContext.equalsNull(startOffset: Int, endOffset: Int, argument: IrEx // a || b == if (a) true else b fun GeneratorContext.oror(startOffset: Int, endOffset: Int, a: IrExpression, b: IrExpression, operator: IrOperator = IrOperator.OROR): IrWhen = IrIfThenElseImpl(startOffset, endOffset, builtIns.booleanType, - a, IrConstImpl.constTrue(b.startOffset, b.endOffset, b.type!!), b, + a, IrConstImpl.constTrue(b.startOffset, b.endOffset, b.type), b, operator) fun GeneratorContext.oror(a: IrExpression, b: IrExpression, operator: IrOperator = IrOperator.OROR): IrWhen = @@ -50,7 +50,7 @@ fun GeneratorContext.whenComma(a: IrExpression, b: IrExpression): IrWhen = // a && b == if (a) b else false fun GeneratorContext.andand(startOffset: Int, endOffset: Int, a: IrExpression, b: IrExpression, operator: IrOperator = IrOperator.ANDAND): IrWhen = IrIfThenElseImpl(startOffset, endOffset, builtIns.booleanType, - a, b, IrConstImpl.constFalse(b.startOffset, b.endOffset, b.type!!), + a, b, IrConstImpl.constFalse(b.startOffset, b.endOffset, b.type), operator) fun GeneratorContext.andand(a: IrExpression, b: IrExpression, operator: IrOperator = IrOperator.ANDAND): IrWhen = diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Scope.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Scope.kt index b6fb5b10dc6..b96b1ecff81 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Scope.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/Scope.kt @@ -25,7 +25,6 @@ import org.jetbrains.kotlin.ir.descriptors.IrTemporaryVariableDescriptorImpl import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.types.KotlinType -import java.lang.AssertionError class Scope(val scopeOwner: DeclarationDescriptor) { private var lastTemporaryIndex: Int = 0 @@ -42,10 +41,7 @@ class Scope(val scopeOwner: DeclarationDescriptor) { fun createTemporaryVariable(irExpression: IrExpression, nameHint: String? = null): IrVariable = IrVariableImpl( irExpression.startOffset, irExpression.endOffset, IrDeclarationOriginKind.IR_TEMPORARY_VARIABLE, - createDescriptorForTemporaryVariable( - irExpression.type ?: throw AssertionError("No type for $irExpression"), - nameHint - ), + createDescriptorForTemporaryVariable(irExpression.type, nameHint), irExpression ) } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/StatementGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/StatementGenerator.kt index 6f95e59cffa..8ae79954de1 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/StatementGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/StatementGenerator.kt @@ -119,7 +119,7 @@ class StatementGenerator( override fun visitReturnExpression(expression: KtReturnExpression, data: Nothing?): IrStatement { val returnTarget = getReturnExpressionTarget(expression) val irReturnedExpression = expression.returnedExpression?.genExpr() - return IrReturnImpl(expression.startOffset, expression.endOffset, returnTarget, irReturnedExpression) + return IrReturnImpl(expression.startOffset, expression.endOffset, context.builtIns.nothingType, returnTarget, irReturnedExpression) } private fun getReturnExpressionTarget(expression: KtReturnExpression): CallableDescriptor = @@ -142,7 +142,7 @@ class StatementGenerator( } override fun visitThrowExpression(expression: KtThrowExpression, data: Nothing?): IrStatement { - return IrThrowImpl(expression.startOffset, expression.endOffset, expression.thrownExpression!!.genExpr()) + return IrThrowImpl(expression.startOffset, expression.endOffset, context.builtIns.nothingType, expression.thrownExpression!!.genExpr()) } override fun visitConstantExpression(expression: KtConstantExpression, data: Nothing?): IrExpression { @@ -174,10 +174,14 @@ class StatementGenerator( return entry0.genExpr() } } - entries.size == 0 -> return IrConstImpl.string(expression.startOffset, expression.endOffset, getInferredTypeWithSmartcastsOrFail(expression), "") + entries.size == 0 -> { + return IrConstImpl.string(expression.startOffset, expression.endOffset, + getInferredTypeWithSmartcastsOrFail(expression), "") + } } - val irStringTemplate = IrStringConcatenationImpl(expression.startOffset, expression.endOffset, getInferredTypeWithSmartcasts(expression)) + val irStringTemplate = IrStringConcatenationImpl(expression.startOffset, expression.endOffset, + getInferredTypeWithSmartcastsOrFail(expression)) entries.forEach { it.expression!!.let { irStringTemplate.addArgument(it.genExpr()) } } return irStringTemplate } @@ -202,17 +206,19 @@ class StatementGenerator( when (descriptor) { is FakeCallableDescriptorForObject -> generateExpressionForReferencedDescriptor(descriptor.getReferencedDescriptor(), expression, resolvedCall) - is ClassDescriptor -> + is ClassDescriptor -> { + val classValueType = descriptor.classValueType!! when { DescriptorUtils.isObject(descriptor) -> - IrGetObjectValueImpl(expression.startOffset, expression.endOffset, descriptor.classValueType, descriptor) + IrGetObjectValueImpl(expression.startOffset, expression.endOffset, classValueType, descriptor) DescriptorUtils.isEnumEntry(descriptor) -> - IrGetEnumValueImpl(expression.startOffset, expression.endOffset, descriptor.classValueType, descriptor) + IrGetEnumValueImpl(expression.startOffset, expression.endOffset, classValueType, descriptor) else -> { - IrGetObjectValueImpl(expression.startOffset, expression.endOffset, descriptor.classValueType, + IrGetObjectValueImpl(expression.startOffset, expression.endOffset, classValueType, descriptor.companionObjectDescriptor ?: throw AssertionError("Class value without companion object: $descriptor")) } } + } is PropertyDescriptor -> { CallGenerator(this).generateCall(expression.startOffset, expression.endOffset, pregenerateCall(resolvedCall)) } @@ -220,7 +226,7 @@ class StatementGenerator( IrGetVariableImpl(expression.startOffset, expression.endOffset, descriptor) else -> IrDummyExpression( - expression.startOffset, expression.endOffset, getInferredTypeWithSmartcasts(expression), + expression.startOffset, expression.endOffset, getInferredTypeWithSmartcastsOrFail(expression), expression.text + ": ${descriptor.name} ${descriptor.javaClass.simpleName}" ) } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/TryCatchExpressionGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/TryCatchExpressionGenerator.kt index 1ee07b5c37b..95b7a840dee 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/TryCatchExpressionGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/TryCatchExpressionGenerator.kt @@ -28,7 +28,7 @@ class TryCatchExpressionGenerator(val statementGenerator: StatementGenerator) : override val context: GeneratorContext get() = statementGenerator.context fun generateTryCatch(ktTry: KtTryExpression): IrExpression { - val resultType = getInferredTypeWithSmartcasts(ktTry) + val resultType = getInferredTypeWithSmartcastsOrFail(ktTry) val irTryCatch = IrTryCatchImpl(ktTry.startOffset, ktTry.endOffset, resultType) irTryCatch.tryResult = statementGenerator.generateExpression(ktTry.tryBlock) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/ArrayAccessAssignmentReceiver.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/ArrayAccessAssignmentReceiver.kt index 7e1cda441f4..75eb076dd8b 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/ArrayAccessAssignmentReceiver.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/ArrayAccessAssignmentReceiver.kt @@ -48,7 +48,7 @@ class ArrayAccessAssignmentReceiver( indexedGetCall?.fillArrayAndIndexArguments(irArrayValue, irIndexValues) indexedSetCall?.fillArrayAndIndexArguments(irArrayValue, irIndexValues) - val irLValue = LValueWithGetterAndSetterCalls(callGenerator, indexedGetCall, indexedSetCall, startOffset, endOffset, operator) + val irLValue = LValueWithGetterAndSetterCalls(callGenerator, indexedGetCall, indexedSetCall, type, startOffset, endOffset, operator) irBlock.inlineStatement(withLValue(irLValue)) return irBlock diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/LValueWithGetterAndSetterCalls.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/LValueWithGetterAndSetterCalls.kt index 00bf6e080f3..86d8a1a28cc 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/LValueWithGetterAndSetterCalls.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/LValueWithGetterAndSetterCalls.kt @@ -28,6 +28,7 @@ class LValueWithGetterAndSetterCalls( val callGenerator: CallGenerator, val getterCall: CallBuilder?, val setterCall: CallBuilder?, + override val type: KotlinType, val startOffset: Int, val endOffset: Int, val operator: IrOperator? = null @@ -39,8 +40,6 @@ class LValueWithGetterAndSetterCalls( private var getterInstantiated = false private var setterInstantiated = false - override val type: KotlinType? get() = descriptor.returnType - override fun load(): IrExpression { if (getterCall == null) throw AssertionError("No getter call for $descriptor") if (getterInstantiated) throw AssertionError("Getter for $descriptor has already been instantiated") diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/OnceCallValue.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/OnceCallValue.kt index 9a752ebcaa8..5884c928c71 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/OnceCallValue.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/OnceCallValue.kt @@ -38,5 +38,5 @@ class OnceCallValue( return CallGenerator(statementGenerator).generateCall(startOffset, endOffset, call, operator) } - override val type: KotlinType? get() = call.descriptor.returnType + override val type: KotlinType get() = call.descriptor.returnType!! } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/OnceExpressionValue.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/OnceExpressionValue.kt index 3bdb4ac6599..3f081192306 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/OnceExpressionValue.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/OnceExpressionValue.kt @@ -35,5 +35,5 @@ class OnceExpressionValue(val irExpression: IrExpression) : IntermediateValue { return irExpression } - override val type: KotlinType? get() = irExpression.type + override val type: KotlinType get() = irExpression.type } \ No newline at end of file diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/RematerializableValue.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/RematerializableValue.kt index 18f808f18b6..57b2d3f3fd0 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/RematerializableValue.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/RematerializableValue.kt @@ -22,8 +22,7 @@ import org.jetbrains.kotlin.psi2ir.generators.Scope import org.jetbrains.kotlin.types.KotlinType class RematerializableValue(val irExpression: IrExpressionWithCopy) : IntermediateValue { - override val type: KotlinType? - get() = irExpression.type + override val type: KotlinType get() = irExpression.type override fun load(): IrExpression = irExpression.copy() } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SafeCallReceiver.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SafeCallReceiver.kt index 15e7fe6e731..b9d079243d1 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SafeCallReceiver.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SafeCallReceiver.kt @@ -49,7 +49,7 @@ class SafeCallReceiver( } val irResult = withDispatchAndExtensionReceivers(dispatchReceiverValue, extensionReceiverValue) - val resultType = irResult.type?.makeNullable() + val resultType = irResult.type.makeNullable() val irBlock = IrBlockImpl(startOffset, endOffset, resultType, IrOperator.SAFE_CALL) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SimplePropertyLValue.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SimplePropertyLValue.kt index f55d8f2542a..976bc25d6d6 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SimplePropertyLValue.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/SimplePropertyLValue.kt @@ -31,8 +31,7 @@ class SimplePropertyLValue( val descriptor: PropertyDescriptor, val callReceiver: CallReceiver ) : LValue, AssignmentReceiver { - override val type: KotlinType? - get() = descriptor.type + override val type: KotlinType get() = descriptor.type override fun load(): IrExpression { val getter = descriptor.getter!! diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/TransientReceiverValue.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/TransientReceiverValue.kt index 2d3979c9dbc..c76824ed3fe 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/TransientReceiverValue.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/TransientReceiverValue.kt @@ -19,7 +19,7 @@ package org.jetbrains.kotlin.psi2ir.intermediate import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.types.KotlinType -class TransientReceiverValue(val description: String, override val type: KotlinType?): IntermediateValue { +class TransientReceiverValue(val description: String, override val type: KotlinType): IntermediateValue { override fun load(): IrExpression { throw AssertionError("Transient receiver should not be instantiated: $description") } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/Values.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/Values.kt index 2dfbb916dff..640138b4b41 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/Values.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/Values.kt @@ -21,7 +21,7 @@ import org.jetbrains.kotlin.types.KotlinType interface IntermediateValue { fun load(): IrExpression - val type: KotlinType? + val type: KotlinType } interface LValue : IntermediateValue { diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/VariableLValue.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/VariableLValue.kt index 3064a73928c..440dc2df7b1 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/VariableLValue.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/intermediate/VariableLValue.kt @@ -23,6 +23,7 @@ import org.jetbrains.kotlin.ir.expressions.IrGetVariableImpl import org.jetbrains.kotlin.ir.expressions.IrOperator import org.jetbrains.kotlin.ir.expressions.IrSetVariableImpl import org.jetbrains.kotlin.types.KotlinType +import org.jetbrains.kotlin.types.typeUtil.builtIns class VariableLValue( val startOffset: Int, @@ -33,13 +34,14 @@ class VariableLValue( constructor(irVariable: IrVariable, irOperator: IrOperator? = null) : this(irVariable.startOffset, irVariable.endOffset, irVariable.descriptor, irOperator) - override val type: KotlinType? get() = descriptor.type + override val type: KotlinType get() = descriptor.type override fun load(): IrExpression = IrGetVariableImpl(startOffset, endOffset, descriptor, irOperator) override fun store(irExpression: IrExpression): IrExpression = - IrSetVariableImpl(startOffset, endOffset, descriptor, irExpression, irOperator) + IrSetVariableImpl(startOffset, endOffset, descriptor.type.builtIns.unitType, + descriptor, irExpression, irOperator) override fun assign(withLValue: (LValue) -> IrExpression): IrExpression = withLValue(this) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InlineSafeCallChains.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InlineSafeCallChains.kt index 08830df9e4f..e6df95df146 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InlineSafeCallChains.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InlineSafeCallChains.kt @@ -51,7 +51,7 @@ class InlineSafeCallChains(val context: GeneratorContext) : IrElementVisitor = ArrayList() diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrCall.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrCall.kt index 1e196082406..535c443bf3d 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrCall.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrCall.kt @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.ir.expressions import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.descriptors.ClassDescriptor +import org.jetbrains.kotlin.descriptors.PropertyAccessorDescriptor import org.jetbrains.kotlin.ir.* import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.types.KotlinType @@ -35,7 +36,7 @@ interface IrCall : IrMemberAccessExpression { class IrCallImpl( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, override val descriptor: CallableDescriptor, override val operator: IrOperator? = null, override val superQualifier: ClassDescriptor? = null @@ -89,7 +90,7 @@ abstract class IrPropertyAccessorCallBase( override val descriptor: CallableDescriptor, override val operator: IrOperator? = null, override val superQualifier: ClassDescriptor? = null -) : IrMemberAccessExpressionBase(startOffset, endOffset, descriptor.returnType), IrCall { +) : IrMemberAccessExpressionBase(startOffset, endOffset, descriptor.returnType!!), IrCall { override fun accept(visitor: IrElementVisitor, data: D): R { return visitor.visitCall(this, data) } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrConst.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrConst.kt index f1d171f5d7a..ad78857f4c4 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrConst.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrConst.kt @@ -47,7 +47,7 @@ sealed class IrConstKind(val asString: kotlin.String) { class IrConstImpl ( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, override val kind: IrConstKind, override val value: T ) : IrTerminalExpressionBase(startOffset, endOffset, type), IrConst { diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDeclarationReference.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDeclarationReference.kt index 4afc54e14f3..2d32d5f8f1a 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDeclarationReference.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDeclarationReference.kt @@ -39,14 +39,14 @@ interface IrGetEnumValue : IrGetSingletonValue abstract class IrDeclarationReferenceBase( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, override val descriptor: D ) : IrExpressionBase(startOffset, endOffset, type), IrDeclarationReference abstract class IrTerminalDeclarationReferenceBase( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, descriptor: D ) : IrDeclarationReferenceBase(startOffset, endOffset, type, descriptor) { override fun getChild(slot: Int): IrElement? = null @@ -63,7 +63,7 @@ abstract class IrTerminalDeclarationReferenceBase class IrGetObjectValueImpl( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, descriptor: ClassDescriptor ) : IrTerminalDeclarationReferenceBase(startOffset, endOffset, type, descriptor), IrGetObjectValue { override fun accept(visitor: IrElementVisitor, data: D): R = @@ -73,7 +73,7 @@ class IrGetObjectValueImpl( class IrGetEnumValueImpl( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, descriptor: ClassDescriptor ) : IrTerminalDeclarationReferenceBase(startOffset, endOffset, type, descriptor), IrGetEnumValue { override fun accept(visitor: IrElementVisitor, data: D): R { diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDummyExpression.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDummyExpression.kt index 8fb8515859f..a2be0ec35bc 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDummyExpression.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDummyExpression.kt @@ -22,7 +22,7 @@ import org.jetbrains.kotlin.types.KotlinType class IrDummyExpression( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, val description: String ) : IrTerminalExpressionBase(startOffset, endOffset, type), IrExpressionWithCopy { override fun accept(visitor: IrElementVisitor, data: D): R = diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrExpression.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrExpression.kt index 7fb5446eb62..7a7234f220b 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrExpression.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrExpression.kt @@ -24,7 +24,7 @@ import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.types.KotlinType interface IrExpression : IrStatement { - val type: KotlinType? + val type: KotlinType } interface IrExpressionWithCopy : IrExpression { @@ -34,13 +34,13 @@ interface IrExpressionWithCopy : IrExpression { abstract class IrExpressionBase( startOffset: Int, endOffset: Int, - override val type: KotlinType? + override val type: KotlinType ) : IrElementBase(startOffset, endOffset), IrExpression abstract class IrTerminalExpressionBase( startOffset: Int, endOffset: Int, - type: KotlinType? + type: KotlinType ) : IrExpressionBase(startOffset, endOffset, type) { override fun getChild(slot: Int): IrElement? = null diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrGetExtensionReceiver.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrGetExtensionReceiver.kt index ce015d7abc3..ee7fe9dc59a 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrGetExtensionReceiver.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrGetExtensionReceiver.kt @@ -29,7 +29,7 @@ interface IrGetExtensionReceiver : IrDeclarationReference, IrExpressionWithCopy class IrGetExtensionReceiverImpl( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, descriptor: ReceiverParameterDescriptor ) : IrTerminalDeclarationReferenceBase(startOffset, endOffset, type, descriptor), IrGetExtensionReceiver { override fun accept(visitor: IrElementVisitor, data: D): R = diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrLoop.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrLoop.kt index e596bba456e..6e2de8c07a3 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrLoop.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrLoop.kt @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.ir.expressions import org.jetbrains.kotlin.ir.* import org.jetbrains.kotlin.ir.visitors.IrElementVisitor +import org.jetbrains.kotlin.types.KotlinType interface IrLoop : IrExpression { val operator: IrOperator? @@ -33,8 +34,9 @@ interface IrDoWhileLoop : IrLoop abstract class IrLoopBase( startOffset: Int, endOffset: Int, + type: KotlinType, override val operator: IrOperator? -) : IrExpressionBase(startOffset, endOffset, null), IrLoop { +) : IrExpressionBase(startOffset, endOffset, type), IrLoop { override var label: String? = null private var conditionImpl: IrExpression? = null @@ -75,15 +77,17 @@ abstract class IrLoopBase( class IrWhileLoopImpl( startOffset: Int, endOffset: Int, + type: KotlinType, operator: IrOperator? -) : IrLoopBase(startOffset, endOffset, operator), IrWhileLoop { +) : IrLoopBase(startOffset, endOffset, type, operator), IrWhileLoop { constructor( startOffset: Int, endOffset: Int, + type: KotlinType, operator: IrOperator?, condition: IrExpression, body: IrExpression - ) : this(startOffset, endOffset, operator) { + ) : this(startOffset, endOffset, type, operator) { this.condition = condition this.body = body } @@ -101,15 +105,17 @@ class IrWhileLoopImpl( class IrDoWhileLoopImpl( startOffset: Int, endOffset: Int, + type : KotlinType, operator: IrOperator? -) : IrLoopBase(startOffset, endOffset, operator), IrDoWhileLoop { +) : IrLoopBase(startOffset, endOffset, type, operator), IrDoWhileLoop { constructor( startOffset: Int, endOffset: Int, + type: KotlinType, operator: IrOperator?, body: IrExpression, condition: IrExpression - ) : this(startOffset, endOffset, operator) { + ) : this(startOffset, endOffset, type, operator) { this.condition = condition this.body = body } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrMemberAccessExpression.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrMemberAccessExpression.kt index 21f90436f56..a9f7a4bf00f 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrMemberAccessExpression.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrMemberAccessExpression.kt @@ -28,7 +28,7 @@ interface IrMemberAccessExpression : IrDeclarationReference { abstract class IrMemberAccessExpressionBase( startOffset: Int, endOffset: Int, - type: KotlinType? + type: KotlinType ) : IrExpressionBase(startOffset, endOffset, type), IrMemberAccessExpression { override var dispatchReceiver: IrExpression? = null set(newReceiver) { diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrPrimitiveCall.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrPrimitiveCall.kt index 78808121d10..ab0d342117f 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrPrimitiveCall.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrPrimitiveCall.kt @@ -27,7 +27,7 @@ abstract class IrPrimitiveCallBase( endOffset: Int, override val operator: IrOperator, override val descriptor: CallableDescriptor -) : IrExpressionBase(startOffset, endOffset, descriptor.returnType), IrCall { +) : IrExpressionBase(startOffset, endOffset, descriptor.returnType!!), IrCall { override val superQualifier: ClassDescriptor? get() = null override var dispatchReceiver: IrExpression? get() = null diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrReturn.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrReturn.kt index 7cbabdb0255..e68aef820bf 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrReturn.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrReturn.kt @@ -30,14 +30,16 @@ interface IrReturn : IrExpression { class IrReturnImpl( startOffset: Int, endOffset: Int, + type: KotlinType, override val returnTarget: CallableDescriptor -) : IrExpressionBase(startOffset, endOffset, null), IrReturn { +) : IrExpressionBase(startOffset, endOffset, type), IrReturn { constructor( startOffset: Int, endOffset: Int, + type: KotlinType, returnTarget: CallableDescriptor, value: IrExpression? - ) : this(startOffset, endOffset, returnTarget) { + ) : this(startOffset, endOffset, type, returnTarget) { this.value = value } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrStringConcatenation.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrStringConcatenation.kt index 0cf63a72978..cfe1b48bad3 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrStringConcatenation.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrStringConcatenation.kt @@ -29,7 +29,7 @@ interface IrStringConcatenation : IrExpression { class IrStringConcatenationImpl( startOffset: Int, endOffset: Int, - type: KotlinType? + type: KotlinType ) : IrExpressionBase(startOffset, endOffset, type), IrStringConcatenation { override val arguments: MutableList = ArrayList() diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrThisReference.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrThisReference.kt index 2ed91ca1463..3031e321e9e 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrThisReference.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrThisReference.kt @@ -28,7 +28,7 @@ interface IrThisReference : IrExpression, IrExpressionWithCopy { class IrThisReferenceImpl( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, override val classDescriptor: ClassDescriptor ) : IrTerminalExpressionBase(startOffset, endOffset, type), IrThisReference { override fun accept(visitor: IrElementVisitor, data: D): R = diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrThrow.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrThrow.kt index bc4792f60df..4bc18930f24 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrThrow.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrThrow.kt @@ -18,14 +18,24 @@ package org.jetbrains.kotlin.ir.expressions import org.jetbrains.kotlin.ir.* import org.jetbrains.kotlin.ir.visitors.IrElementVisitor +import org.jetbrains.kotlin.types.KotlinType interface IrThrow : IrExpression { var value: IrExpression } -class IrThrowImpl(startOffset: Int, endOffset: Int) : IrExpressionBase(startOffset, endOffset, null), IrThrow { - constructor(startOffset: Int, endOffset: Int, value: IrExpression) : this(startOffset, endOffset) { +class IrThrowImpl( + startOffset: Int, + endOffset: Int, + type: KotlinType +) : IrExpressionBase(startOffset, endOffset, type), IrThrow { + constructor( + startOffset: Int, + endOffset: Int, + type: KotlinType, + value: IrExpression + ) : this(startOffset, endOffset, type) { this.value = value } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrTryCatch.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrTryCatch.kt index 73c1062d3a0..ac3cbc294fd 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrTryCatch.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrTryCatch.kt @@ -37,7 +37,7 @@ val IrTryCatch.catchClauseIndices: IntRange get() = 0 ..catchClausesCount - 1 class IrTryCatchImpl( startOffset: Int, endOffset: Int, - type: KotlinType? + type: KotlinType ) : IrExpressionBase(startOffset, endOffset, type), IrTryCatch { private var tryResultImpl: IrExpression? = null override var tryResult: IrExpression diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrTypeOperatorCall.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrTypeOperatorCall.kt index 40f2dbf1cde..c001c208ada 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrTypeOperatorCall.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrTypeOperatorCall.kt @@ -38,14 +38,14 @@ interface IrTypeOperatorCall : IrExpression { class IrTypeOperatorCallImpl( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, override val operator: IrTypeOperator, override val typeOperand: KotlinType ) : IrExpressionBase(startOffset, endOffset, type), IrTypeOperatorCall { constructor( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, operator: IrTypeOperator, typeOperand: KotlinType, argument: IrExpression diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrVariableAccessExpression.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrVariableAccessExpression.kt index 4051f643a53..7321893d77c 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrVariableAccessExpression.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrVariableAccessExpression.kt @@ -50,16 +50,18 @@ class IrGetVariableImpl( class IrSetVariableImpl( startOffset: Int, endOffset: Int, + type: KotlinType, override val descriptor: VariableDescriptor, override val operator: IrOperator? -) : IrExpressionBase(startOffset, endOffset, null), IrSetVariable { +) : IrExpressionBase(startOffset, endOffset, type), IrSetVariable { constructor( startOffset: Int, endOffset: Int, + type: KotlinType, descriptor: VariableDescriptor, value: IrExpression, operator: IrOperator? - ) : this(startOffset, endOffset, descriptor, operator) { + ) : this(startOffset, endOffset, type, descriptor, operator) { this.value = value } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrWhen.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrWhen.kt index 38a58b37b08..87162f1fc83 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrWhen.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrWhen.kt @@ -36,7 +36,7 @@ val IrWhen.branchIndices: IntRange get() = 0 ..branchesCount - 1 class IrWhenImpl( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, override val operator: IrOperator? = null ) : IrExpressionBase(startOffset, endOffset, type), IrWhen { private val branchParts = ArrayList() @@ -97,13 +97,13 @@ class IrWhenImpl( class IrIfThenElseImpl( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, override val operator: IrOperator? = null ) : IrExpressionBase(startOffset, endOffset, type), IrWhen { constructor( startOffset: Int, endOffset: Int, - type: KotlinType?, + type: KotlinType, condition: IrExpression, thenBranch: IrExpression, elseBranch: IrExpression? = null, diff --git a/compiler/testData/ir/irText/arrayAccess.txt b/compiler/testData/ir/irText/arrayAccess.txt index 07d898bd8ca..1557624afb1 100644 --- a/compiler/testData/ir/irText/arrayAccess.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing CONST Int type=kotlin.Int value='1' FUN public fun test(/*0*/ a: kotlin.IntArray): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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/arrayAssignment.txt b/compiler/testData/ir/irText/arrayAssignment.txt index 6a811513052..bd360b517ba 100644 --- a/compiler/testData/ir/irText/arrayAssignment.txt +++ b/compiler/testData/ir/irText/arrayAssignment.txt @@ -11,7 +11,7 @@ FILE /arrayAssignment.kt value: CONST Int type=kotlin.Int value='0' FUN public fun foo(): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CONST Int type=kotlin.Int value='1' FUN public fun test2(): kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/arrayAugmentedAssignment1.txt b/compiler/testData/ir/irText/arrayAugmentedAssignment1.txt index f2590048a63..86a1a6f715f 100644 --- a/compiler/testData/ir/irText/arrayAugmentedAssignment1.txt +++ b/compiler/testData/ir/irText/arrayAugmentedAssignment1.txt @@ -1,13 +1,13 @@ FILE /arrayAugmentedAssignment1.kt FUN public fun foo(): kotlin.IntArray BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CALL .intArrayOf type=kotlin.IntArray operator=null elements: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.IntArray DUMMY vararg type=kotlin.Int FUN public fun bar(): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CONST Int type=kotlin.Int value='42' DUMMY C FUN public fun testVariable(): kotlin.Unit diff --git a/compiler/testData/ir/irText/assignments.txt b/compiler/testData/ir/irText/assignments.txt index 3f78304e100..b304cbce81c 100644 --- a/compiler/testData/ir/irText/assignments.txt +++ b/compiler/testData/ir/irText/assignments.txt @@ -4,9 +4,9 @@ FILE /assignments.kt BLOCK_BODY VAR var x: kotlin.Int CONST Int type=kotlin.Int value='0' - SET_VAR x type= operator=EQ + SET_VAR x type=kotlin.Unit operator=EQ CONST Int type=kotlin.Int value='1' - SET_VAR x type= operator=EQ + SET_VAR x type=kotlin.Unit operator=EQ CALL .plus type=kotlin.Int operator=PLUS $this: GET_VAR x type=kotlin.Int operator=null other: CONST Int type=kotlin.Int value='1' diff --git a/compiler/testData/ir/irText/augmentedAssignment1.txt b/compiler/testData/ir/irText/augmentedAssignment1.txt index b34bc90f98a..5aec09b1840 100644 --- a/compiler/testData/ir/irText/augmentedAssignment1.txt +++ b/compiler/testData/ir/irText/augmentedAssignment1.txt @@ -6,23 +6,23 @@ FILE /augmentedAssignment1.kt BLOCK_BODY VAR var x: kotlin.Int CONST Int type=kotlin.Int value='0' - SET_VAR x type= operator=PLUSEQ + SET_VAR x type=kotlin.Unit operator=PLUSEQ CALL .plus type=kotlin.Int operator=PLUSEQ $this: GET_VAR x type=kotlin.Int operator=PLUSEQ other: CONST Int type=kotlin.Int value='1' - SET_VAR x type= operator=MINUSEQ + SET_VAR x type=kotlin.Unit operator=MINUSEQ CALL .minus type=kotlin.Int operator=MINUSEQ $this: GET_VAR x type=kotlin.Int operator=MINUSEQ other: CONST Int type=kotlin.Int value='2' - SET_VAR x type= operator=MULTEQ + SET_VAR x type=kotlin.Unit operator=MULTEQ CALL .times type=kotlin.Int operator=MULTEQ $this: GET_VAR x type=kotlin.Int operator=MULTEQ other: CONST Int type=kotlin.Int value='3' - SET_VAR x type= operator=DIVEQ + SET_VAR x type=kotlin.Unit operator=DIVEQ CALL .div type=kotlin.Int operator=DIVEQ $this: GET_VAR x type=kotlin.Int operator=DIVEQ other: CONST Int type=kotlin.Int value='4' - SET_VAR x type= operator=PERCEQ + SET_VAR x type=kotlin.Unit operator=PERCEQ CALL .mod type=kotlin.Int operator=PERCEQ $this: GET_VAR x type=kotlin.Int operator=PERCEQ other: CONST Int type=kotlin.Int value='5' diff --git a/compiler/testData/ir/irText/booleanOperators.txt b/compiler/testData/ir/irText/booleanOperators.txt index e6ea539874a..95c8d192970 100644 --- a/compiler/testData/ir/irText/booleanOperators.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/boxOk.txt b/compiler/testData/ir/irText/boxOk.txt index 20f7ece0fce..a91c03e24a2 100644 --- a/compiler/testData/ir/irText/boxOk.txt +++ b/compiler/testData/ir/irText/boxOk.txt @@ -1,5 +1,5 @@ FILE /boxOk.kt FUN public fun box(): kotlin.String BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CONST String type=kotlin.String value='OK' diff --git a/compiler/testData/ir/irText/callWithReorderedArguments.txt b/compiler/testData/ir/irText/callWithReorderedArguments.txt index ec550fa533d..af7e716b6c9 100644 --- a/compiler/testData/ir/irText/callWithReorderedArguments.txt +++ b/compiler/testData/ir/irText/callWithReorderedArguments.txt @@ -3,19 +3,19 @@ FILE /callWithReorderedArguments.kt BLOCK_BODY FUN public fun noReorder1(): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CONST Int type=kotlin.Int value='1' FUN public fun noReorder2(): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CONST Int type=kotlin.Int value='2' FUN public fun reordered1(): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CONST Int type=kotlin.Int value='1' FUN public fun reordered2(): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CONST Int type=kotlin.Int value='2' FUN public fun test(): kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/calls.txt b/compiler/testData/ir/irText/calls.txt index c0b025ff34e..fac4118cdf4 100644 --- a/compiler/testData/ir/irText/calls.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing GET_VAR x type=kotlin.Int operator=null FUN public fun bar(/*0*/ x: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing $RECEIVER of: ext1 type=kotlin.Int FUN public fun kotlin.Int.ext2(/*0*/ x: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/chainOfSafeCalls.txt b/compiler/testData/ir/irText/chainOfSafeCalls.txt index 54c9f185096..44ef35e5260 100644 --- a/compiler/testData/ir/irText/chainOfSafeCalls.txt +++ b/compiler/testData/ir/irText/chainOfSafeCalls.txt @@ -2,7 +2,7 @@ FILE /chainOfSafeCalls.kt DUMMY C FUN public fun test(/*0*/ nc: C?): C? BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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/conventionComparisons.txt b/compiler/testData/ir/irText/conventionComparisons.txt index f24af563f91..914072a66bf 100644 --- a/compiler/testData/ir/irText/conventionComparisons.txt +++ b/compiler/testData/ir/irText/conventionComparisons.txt @@ -3,7 +3,7 @@ FILE /conventionComparisons.kt DUMMY IB FUN public fun IB.test1(/*0*/ a1: IA, /*1*/ a2: IA): kotlin.Boolean BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CALL .GT0 type=kotlin.Boolean operator=GT arg0: CALL .compareTo type=kotlin.Int operator=GT $this: $RECEIVER of: test1 type=IB @@ -11,7 +11,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= + RETURN type=kotlin.Nothing CALL .GTEQ0 type=kotlin.Boolean operator=GTEQ arg0: CALL .compareTo type=kotlin.Int operator=GTEQ $this: $RECEIVER of: test2 type=IB @@ -19,7 +19,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= + RETURN type=kotlin.Nothing CALL .LT0 type=kotlin.Boolean operator=LT arg0: CALL .compareTo type=kotlin.Int operator=LT $this: $RECEIVER of: test3 type=IB @@ -27,7 +27,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= + RETURN type=kotlin.Nothing 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/dotQualified.txt b/compiler/testData/ir/irText/dotQualified.txt index 46dd94ccd98..36969013325 100644 --- a/compiler/testData/ir/irText/dotQualified.txt +++ b/compiler/testData/ir/irText/dotQualified.txt @@ -1,12 +1,12 @@ FILE /dotQualified.kt FUN public fun length(/*0*/ s: kotlin.String): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/elvis.txt b/compiler/testData/ir/irText/elvis.txt index 9f9924d3aff..8a77670561c 100644 --- a/compiler/testData/ir/irText/elvis.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + then: RETURN type=kotlin.Nothing 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= + then: RETURN type=kotlin.Nothing CONST String type=kotlin.String value='' - RETURN type= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/equality.txt b/compiler/testData/ir/irText/equality.txt index e17e869b8bd..48c609da03b 100644 --- a/compiler/testData/ir/irText/equality.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/extensionPropertyGetterCall.txt b/compiler/testData/ir/irText/extensionPropertyGetterCall.txt index 580673c9a67..275646d0506 100644 --- a/compiler/testData/ir/irText/extensionPropertyGetterCall.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing CONST String type=kotlin.String value='OK' FUN public fun kotlin.String.test5(): kotlin.String BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CALL . type=kotlin.String operator=GET_PROPERTY $receiver: $RECEIVER of: test5 type=kotlin.String diff --git a/compiler/testData/ir/irText/identity.txt b/compiler/testData/ir/irText/identity.txt index 26fffd1dba9..60540e93719 100644 --- a/compiler/testData/ir/irText/identity.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/ifElseIf.txt b/compiler/testData/ir/irText/ifElseIf.txt index 7f0b1c6765c..c68fe40d11c 100644 --- a/compiler/testData/ir/irText/ifElseIf.txt +++ b/compiler/testData/ir/irText/ifElseIf.txt @@ -1,7 +1,7 @@ FILE /ifElseIf.kt FUN public fun test(/*0*/ i: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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/implicitCastOnPlatformType.txt b/compiler/testData/ir/irText/implicitCastOnPlatformType.txt index 3c9a73994f7..be73813d959 100644 --- a/compiler/testData/ir/irText/implicitCastOnPlatformType.txt +++ b/compiler/testData/ir/irText/implicitCastOnPlatformType.txt @@ -1,7 +1,7 @@ FILE /implicitCastOnPlatformType.kt FUN public fun test(): kotlin.String BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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/in.txt b/compiler/testData/ir/irText/in.txt index 6fc14a362f3..57a5eceaaea 100644 --- a/compiler/testData/ir/irText/in.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/incrementDecrement.txt b/compiler/testData/ir/irText/incrementDecrement.txt index 696eeed143d..b4de85fa190 100644 --- a/compiler/testData/ir/irText/incrementDecrement.txt +++ b/compiler/testData/ir/irText/incrementDecrement.txt @@ -16,7 +16,7 @@ FILE /incrementDecrement.kt VAR val tmp0: kotlin.Int CALL .inc type=kotlin.Int operator=PREFIX_INCR $this: GET_VAR x type=kotlin.Int operator=PREFIX_INCR - SET_VAR x type= operator=PREFIX_INCR + SET_VAR x type=kotlin.Unit operator=PREFIX_INCR GET_VAR tmp0 type=kotlin.Int operator=null GET_VAR tmp0 type=kotlin.Int operator=null VAR val x2: kotlin.Int @@ -24,7 +24,7 @@ FILE /incrementDecrement.kt VAR val tmp1: kotlin.Int CALL .dec type=kotlin.Int operator=PREFIX_DECR $this: GET_VAR x type=kotlin.Int operator=PREFIX_DECR - SET_VAR x type= operator=PREFIX_DECR + SET_VAR x type=kotlin.Unit operator=PREFIX_DECR GET_VAR tmp1 type=kotlin.Int operator=null GET_VAR tmp1 type=kotlin.Int operator=null FUN public fun testVarPostfix(): kotlin.Unit @@ -35,7 +35,7 @@ FILE /incrementDecrement.kt BLOCK type=kotlin.Int operator=POSTFIX_INCR VAR val tmp0: kotlin.Int GET_VAR x type=kotlin.Int operator=POSTFIX_INCR - SET_VAR x type= operator=POSTFIX_INCR + SET_VAR x type=kotlin.Unit operator=POSTFIX_INCR CALL .inc type=kotlin.Int operator=POSTFIX_INCR $this: GET_VAR tmp0 type=kotlin.Int operator=null GET_VAR tmp0 type=kotlin.Int operator=null @@ -43,7 +43,7 @@ FILE /incrementDecrement.kt BLOCK type=kotlin.Int operator=POSTFIX_DECR VAR val tmp1: kotlin.Int GET_VAR x type=kotlin.Int operator=POSTFIX_DECR - SET_VAR x type= operator=POSTFIX_DECR + SET_VAR x type=kotlin.Unit operator=POSTFIX_DECR CALL .dec type=kotlin.Int operator=POSTFIX_DECR $this: GET_VAR tmp1 type=kotlin.Int operator=null GET_VAR tmp1 type=kotlin.Int operator=null diff --git a/compiler/testData/ir/irText/primitiveComparisons.txt b/compiler/testData/ir/irText/primitiveComparisons.txt index 1c517001d80..68b01b1585a 100644 --- a/compiler/testData/ir/irText/primitiveComparisons.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/references.txt b/compiler/testData/ir/irText/references.txt index 3d78d25e51f..87fd4af4c04 100644 --- a/compiler/testData/ir/irText/references.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing CONST String type=kotlin.String value='OK' FUN public fun test1(): kotlin.String BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CALL . type=kotlin.String operator=GET_PROPERTY FUN public fun test2(/*0*/ x: kotlin.String): kotlin.String BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing GET_VAR x type=kotlin.String operator=null FUN public fun test4(): kotlin.String BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing CONST String type=kotlin.String value='OK' FUN public fun kotlin.String.test5(): kotlin.String BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CALL . type=kotlin.String operator=GET_PROPERTY $receiver: $RECEIVER of: test5 type=kotlin.String diff --git a/compiler/testData/ir/irText/safeCallWithIncrementDecrement.txt b/compiler/testData/ir/irText/safeCallWithIncrementDecrement.txt index 600b67d37cc..529f591cc7d 100644 --- a/compiler/testData/ir/irText/safeCallWithIncrementDecrement.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/safeCalls.txt b/compiler/testData/ir/irText/safeCalls.txt index 5a3beccf817..0ffe37c5229 100644 --- a/compiler/testData/ir/irText/safeCalls.txt +++ b/compiler/testData/ir/irText/safeCalls.txt @@ -3,7 +3,7 @@ FILE /safeCalls.kt DUMMY IHost FUN public fun test1(/*0*/ x: kotlin.String?): kotlin.Int? BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing WHEN type=kotlin.Int? operator=SAFE_CALL if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: GET_VAR x type=kotlin.String? operator=null @@ -13,7 +13,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= + RETURN type=kotlin.Nothing WHEN type=kotlin.Int? operator=SAFE_CALL if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: GET_VAR x type=kotlin.String? operator=null @@ -23,7 +23,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= + RETURN type=kotlin.Nothing WHEN type=kotlin.Boolean? operator=SAFE_CALL if: CALL .EQEQ type=kotlin.Boolean operator=EQEQ arg0: GET_VAR x type=kotlin.String? operator=null @@ -44,7 +44,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= + RETURN type=kotlin.Nothing 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/simpleOperators.txt b/compiler/testData/ir/irText/simpleOperators.txt index 07313ae5ef2..f318f07b232 100644 --- a/compiler/testData/ir/irText/simpleOperators.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/simpleUnaryOperators.txt b/compiler/testData/ir/irText/simpleUnaryOperators.txt index 3cafbfa6138..4fdbc9e609e 100644 --- a/compiler/testData/ir/irText/simpleUnaryOperators.txt +++ b/compiler/testData/ir/irText/simpleUnaryOperators.txt @@ -1,31 +1,31 @@ FILE /simpleUnaryOperators.kt FUN public fun test1(/*0*/ x: kotlin.Int): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing CALL .not type=kotlin.Boolean operator=EXCL $this: CONST Boolean type=kotlin.Boolean value='true' diff --git a/compiler/testData/ir/irText/smartCasts.txt b/compiler/testData/ir/irText/smartCasts.txt index 67e25f75857..3b12758c939 100644 --- a/compiler/testData/ir/irText/smartCasts.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing GET_VAR s type=kotlin.String operator=null FUN public fun overloaded(/*0*/ x: kotlin.Any): kotlin.Any BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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= + then: RETURN type=kotlin.Nothing 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= + then: RETURN type=kotlin.Nothing CONST String type=kotlin.String value='' - RETURN type= + RETURN type=kotlin.Nothing 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= + then: RETURN type=kotlin.Nothing CONST String type=kotlin.String value='' - RETURN type= + RETURN type=kotlin.Nothing TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String GET_VAR x type=kotlin.Any operator=null diff --git a/compiler/testData/ir/irText/smartCastsWithDestructuring.txt b/compiler/testData/ir/irText/smartCastsWithDestructuring.txt index 71787f20856..8be070005d0 100644 --- a/compiler/testData/ir/irText/smartCastsWithDestructuring.txt +++ b/compiler/testData/ir/irText/smartCastsWithDestructuring.txt @@ -3,18 +3,18 @@ FILE /smartCastsWithDestructuring.kt DUMMY I2 FUN public operator fun I1.component1(): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CONST Int type=kotlin.Int value='1' FUN public operator fun I2.component2(): kotlin.String BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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= + then: RETURN type=kotlin.Nothing 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/smoke.txt b/compiler/testData/ir/irText/smoke.txt index 36320275465..b3e940f5678 100644 --- a/compiler/testData/ir/irText/smoke.txt +++ b/compiler/testData/ir/irText/smoke.txt @@ -1,7 +1,7 @@ FILE /smoke.kt FUN public fun testFun(): kotlin.String BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/stringComparisons.txt b/compiler/testData/ir/irText/stringComparisons.txt index 0c376d3f4e2..41a5a607fd8 100644 --- a/compiler/testData/ir/irText/stringComparisons.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/stringPlus.txt b/compiler/testData/ir/irText/stringPlus.txt index d1abdb8dc67..23742252185 100644 --- a/compiler/testData/ir/irText/stringPlus.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/throw.txt b/compiler/testData/ir/irText/throw.txt index c30f7d9e19f..bb7f30a1a3b 100644 --- a/compiler/testData/ir/irText/throw.txt +++ b/compiler/testData/ir/irText/throw.txt @@ -1,7 +1,7 @@ FILE /throw.kt FUN public fun test1(): kotlin.Unit BLOCK_BODY - THROW type= + THROW type=kotlin.Nothing CALL . type=kotlin.Throwable operator=null FUN public fun testImplicitCast(/*0*/ a: kotlin.Any): kotlin.Unit BLOCK_BODY @@ -9,6 +9,6 @@ FILE /throw.kt if: TYPE_OP operator=INSTANCEOF typeOperand=kotlin.Throwable GET_VAR a type=kotlin.Any operator=null then: BLOCK type=kotlin.Nothing operator=null - THROW type= + THROW type=kotlin.Nothing TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Throwable GET_VAR a type=kotlin.Any operator=null diff --git a/compiler/testData/ir/irText/tryCatch.txt b/compiler/testData/ir/irText/tryCatch.txt index 7ff17e87afb..b01a6b2983d 100644 --- a/compiler/testData/ir/irText/tryCatch.txt +++ b/compiler/testData/ir/irText/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= + RETURN type=kotlin.Nothing 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/tryCatchWithImplicitCast.txt b/compiler/testData/ir/irText/tryCatchWithImplicitCast.txt index 927ddca5a3d..1b8930e9f70 100644 --- a/compiler/testData/ir/irText/tryCatchWithImplicitCast.txt +++ b/compiler/testData/ir/irText/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= + then: RETURN type=kotlin.Nothing VAR val t: kotlin.String TRY_CATCH type=kotlin.String try: BLOCK type=kotlin.String operator=null diff --git a/compiler/testData/ir/irText/typeOperators.txt b/compiler/testData/ir/irText/typeOperators.txt index 3e463fc3349..eaf22a3738b 100644 --- a/compiler/testData/ir/irText/typeOperators.txt +++ b/compiler/testData/ir/irText/typeOperators.txt @@ -2,21 +2,21 @@ FILE /typeOperators.kt DUMMY IThing FUN public fun test1(/*0*/ x: kotlin.Any): kotlin.Boolean BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing TYPE_OP operator=SAFE_CAST typeOperand=IThing GET_VAR x type=kotlin.Any operator=null diff --git a/compiler/testData/ir/irText/values.txt b/compiler/testData/ir/irText/values.txt index 4bf4b9bd526..4bd3b8ba7b6 100644 --- a/compiler/testData/ir/irText/values.txt +++ b/compiler/testData/ir/irText/values.txt @@ -7,17 +7,17 @@ FILE /values.kt DUMMY Z FUN public fun test1(): Enum BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing GET_ENUM_VALUE A type=Enum FUN public fun test2(): A BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing GET_OBJECT A type=A FUN public fun test3(): kotlin.Int BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing CALL . type=kotlin.Int operator=GET_PROPERTY FUN public fun test4(): Z.Companion BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing GET_OBJECT Companion type=Z.Companion diff --git a/compiler/testData/ir/irText/variableAsFunctionCall.txt b/compiler/testData/ir/irText/variableAsFunctionCall.txt index 0f9f13e8864..fed6af9f412 100644 --- a/compiler/testData/ir/irText/variableAsFunctionCall.txt +++ b/compiler/testData/ir/irText/variableAsFunctionCall.txt @@ -1,28 +1,28 @@ FILE /variableAsFunctionCall.kt FUN public fun kotlin.String.k(): () -> kotlin.String BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing DUMMY KtLambdaExpression type=() -> kotlin.String FUN public fun test1(/*0*/ f: () -> kotlin.Unit): kotlin.Unit BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/when.txt b/compiler/testData/ir/irText/when.txt index 1c359995c62..9a1a101f900 100644 --- a/compiler/testData/ir/irText/when.txt +++ b/compiler/testData/ir/irText/when.txt @@ -2,7 +2,7 @@ FILE /when.kt DUMMY A FUN public fun testWithSubject(/*0*/ x: kotlin.Any?): kotlin.String BLOCK_BODY - RETURN type= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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= + RETURN type=kotlin.Nothing 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/whileDoWhile.txt b/compiler/testData/ir/irText/whileDoWhile.txt index 3ced1f94aa3..88563439e2a 100644 --- a/compiler/testData/ir/irText/whileDoWhile.txt +++ b/compiler/testData/ir/irText/whileDoWhile.txt @@ -11,7 +11,7 @@ FILE /whileDoWhile.kt body: BLOCK type=kotlin.Int operator=POSTFIX_INCR VAR val tmp0: kotlin.Int GET_VAR x type=kotlin.Int operator=POSTFIX_INCR - SET_VAR x type= operator=POSTFIX_INCR + SET_VAR x type=kotlin.Unit operator=POSTFIX_INCR CALL .inc type=kotlin.Int operator=POSTFIX_INCR $this: GET_VAR tmp0 type=kotlin.Int operator=null GET_VAR tmp0 type=kotlin.Int operator=null @@ -24,7 +24,7 @@ FILE /whileDoWhile.kt BLOCK type=kotlin.Int operator=POSTFIX_INCR VAR val tmp1: kotlin.Int GET_VAR x type=kotlin.Int operator=POSTFIX_INCR - SET_VAR x type= operator=POSTFIX_INCR + SET_VAR x type=kotlin.Unit operator=POSTFIX_INCR CALL .inc type=kotlin.Int operator=POSTFIX_INCR $this: GET_VAR tmp1 type=kotlin.Int operator=null GET_VAR tmp1 type=kotlin.Int operator=null @@ -32,7 +32,7 @@ FILE /whileDoWhile.kt body: BLOCK type=kotlin.Int operator=POSTFIX_INCR VAR val tmp2: kotlin.Int GET_VAR x type=kotlin.Int operator=POSTFIX_INCR - SET_VAR x type= operator=POSTFIX_INCR + SET_VAR x type=kotlin.Unit operator=POSTFIX_INCR CALL .inc type=kotlin.Int operator=POSTFIX_INCR $this: GET_VAR tmp2 type=kotlin.Int operator=null GET_VAR tmp2 type=kotlin.Int operator=null @@ -45,7 +45,7 @@ FILE /whileDoWhile.kt BLOCK type=kotlin.Int operator=POSTFIX_INCR VAR val tmp3: kotlin.Int GET_VAR x type=kotlin.Int operator=POSTFIX_INCR - SET_VAR x type= operator=POSTFIX_INCR + SET_VAR x type=kotlin.Unit operator=POSTFIX_INCR CALL .inc type=kotlin.Int operator=POSTFIX_INCR $this: GET_VAR tmp3 type=kotlin.Int operator=null GET_VAR tmp3 type=kotlin.Int operator=null