IrExpression.type is no longer nullable.

Change expression typing contract.
This commit is contained in:
Dmitry Petrov
2016-08-25 14:38:32 +03:00
committed by Dmitry Petrov
parent be86739d3a
commit 179a06672b
78 changed files with 262 additions and 238 deletions
@@ -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)
}
@@ -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<Pair<IrExpression, IrExpression>>()
@@ -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)
@@ -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
@@ -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)
IrDummyExpression(ktExpression.startOffset, ktExpression.endOffset, getInferredTypeWithSmartcastsOrFail(ktExpression), description)
@@ -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)
@@ -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 =
@@ -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
)
}
@@ -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}"
)
}
@@ -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)
@@ -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
@@ -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")
@@ -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!!
}
@@ -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
}
@@ -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()
}
@@ -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)
@@ -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!!
@@ -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")
}
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.types.KotlinType
interface IntermediateValue {
fun load(): IrExpression
val type: KotlinType?
val type: KotlinType
}
interface LValue : IntermediateValue {
@@ -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)
@@ -51,7 +51,7 @@ class InlineSafeCallChains(val context: GeneratorContext) : IrElementVisitor<Uni
}
private fun rewriteSafeCallChain(outer: SafeCallInfo, inner: SafeCallInfo) {
val innerNestedCallReturnType = inner.nestedCall.type ?: return
val innerNestedCallReturnType = inner.nestedCall.type
if (innerNestedCallReturnType.containsNull()) return
outer.root.replaceWith {
@@ -55,7 +55,7 @@ class InsertImplicitCasts(val builtIns: KotlinBuiltIns): IrElementVisitor<Unit,
override fun visitBlock(expression: IrBlock, data: Nothing?) {
expression.acceptChildren(this, null)
val type = expression.type
if (type == null || KotlinBuiltIns.isUnit(type)) return
if (KotlinBuiltIns.isUnit(type)) return
if (expression.statements.isEmpty()) return
val lastStatement = expression.statements.last()
@@ -120,12 +120,11 @@ class InsertImplicitCasts(val builtIns: KotlinBuiltIns): IrElementVisitor<Unit,
}
private fun IrExpression.wrapWithImplicitCast(expectedType: KotlinType?): IrExpression {
if (this is IrBlock && this.type == null) return this
if (expectedType == null) return this
if (expectedType.isError) return this
if (KotlinBuiltIns.isUnit(expectedType)) return this // TODO expose coercion to Unit in IR?
val valueType = this.type ?: return this
val valueType = this.type
if (valueType.isNullabilityFlexible() && valueType.containsNull() && !expectedType.containsNull()) {
val nonNullValueType = valueType.upperIfFlexible().makeNotNullable();
@@ -35,7 +35,7 @@ fun IrBlockImpl.addIfNotNull(statement: IrStatement?) {
class IrBlockImpl(
startOffset: Int,
endOffset: Int,
type: KotlinType?,
type: KotlinType,
override val operator: IrOperator? = null
) : IrExpressionBase(startOffset, endOffset, type), IrBlock {
override val statements: MutableList<IrStatement> = ArrayList()
@@ -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 <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R {
return visitor.visitCall(this, data)
}
@@ -47,7 +47,7 @@ sealed class IrConstKind<out T>(val asString: kotlin.String) {
class IrConstImpl<out T> (
startOffset: Int,
endOffset: Int,
type: KotlinType?,
type: KotlinType,
override val kind: IrConstKind<T>,
override val value: T
) : IrTerminalExpressionBase(startOffset, endOffset, type), IrConst<T> {
@@ -39,14 +39,14 @@ interface IrGetEnumValue : IrGetSingletonValue
abstract class IrDeclarationReferenceBase<out D : DeclarationDescriptor>(
startOffset: Int,
endOffset: Int,
type: KotlinType?,
type: KotlinType,
override val descriptor: D
) : IrExpressionBase(startOffset, endOffset, type), IrDeclarationReference
abstract class IrTerminalDeclarationReferenceBase<out D : DeclarationDescriptor>(
startOffset: Int,
endOffset: Int,
type: KotlinType?,
type: KotlinType,
descriptor: D
) : IrDeclarationReferenceBase<D>(startOffset, endOffset, type, descriptor) {
override fun getChild(slot: Int): IrElement? = null
@@ -63,7 +63,7 @@ abstract class IrTerminalDeclarationReferenceBase<out D : DeclarationDescriptor>
class IrGetObjectValueImpl(
startOffset: Int,
endOffset: Int,
type: KotlinType?,
type: KotlinType,
descriptor: ClassDescriptor
) : IrTerminalDeclarationReferenceBase<ClassDescriptor>(startOffset, endOffset, type, descriptor), IrGetObjectValue {
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
@@ -73,7 +73,7 @@ class IrGetObjectValueImpl(
class IrGetEnumValueImpl(
startOffset: Int,
endOffset: Int,
type: KotlinType?,
type: KotlinType,
descriptor: ClassDescriptor
) : IrTerminalDeclarationReferenceBase<ClassDescriptor>(startOffset, endOffset, type, descriptor), IrGetEnumValue {
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R {
@@ -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 <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
@@ -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
@@ -29,7 +29,7 @@ interface IrGetExtensionReceiver : IrDeclarationReference, IrExpressionWithCopy
class IrGetExtensionReceiverImpl(
startOffset: Int,
endOffset: Int,
type: KotlinType?,
type: KotlinType,
descriptor: ReceiverParameterDescriptor
) : IrTerminalDeclarationReferenceBase<ReceiverParameterDescriptor>(startOffset, endOffset, type, descriptor), IrGetExtensionReceiver {
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
@@ -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
}
@@ -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) {
@@ -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
@@ -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
}
@@ -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<IrExpression> = ArrayList()
@@ -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 <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
@@ -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
}
@@ -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
@@ -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
@@ -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
}
@@ -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<IrExpression>()
@@ -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,
+2 -2
View File
@@ -4,11 +4,11 @@ FILE /arrayAccess.kt
CONST Int type=kotlin.Int value='0'
FUN public fun foo(): kotlin.Int
BLOCK_BODY
RETURN type=<no-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=<no-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
+1 -1
View File
@@ -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=<no-type>
RETURN type=kotlin.Nothing
CONST Int type=kotlin.Int value='1'
FUN public fun test2(): kotlin.Unit
BLOCK_BODY
+2 -2
View File
@@ -1,13 +1,13 @@
FILE /arrayAugmentedAssignment1.kt
FUN public fun foo(): kotlin.IntArray
BLOCK_BODY
RETURN type=<no-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=<no-type>
RETURN type=kotlin.Nothing
CONST Int type=kotlin.Int value='42'
DUMMY C
FUN public fun testVariable(): kotlin.Unit
+2 -2
View File
@@ -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=<no-type> operator=EQ
SET_VAR x type=kotlin.Unit operator=EQ
CONST Int type=kotlin.Int value='1'
SET_VAR x type=<no-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'
+5 -5
View File
@@ -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=<no-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=<no-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=<no-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=<no-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=<no-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'
+4 -4
View File
@@ -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=<no-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=<no-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=<no-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=<no-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
+1 -1
View File
@@ -1,5 +1,5 @@
FILE /boxOk.kt
FUN public fun box(): kotlin.String
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CONST String type=kotlin.String value='OK'
+4 -4
View File
@@ -3,19 +3,19 @@ FILE /callWithReorderedArguments.kt
BLOCK_BODY
FUN public fun noReorder1(): kotlin.Int
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CONST Int type=kotlin.Int value='1'
FUN public fun noReorder2(): kotlin.Int
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CONST Int type=kotlin.Int value='2'
FUN public fun reordered1(): kotlin.Int
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CONST Int type=kotlin.Int value='1'
FUN public fun reordered2(): kotlin.Int
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CONST Int type=kotlin.Int value='2'
FUN public fun test(): kotlin.Unit
BLOCK_BODY
+6 -6
View File
@@ -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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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
+1 -1
View File
@@ -2,7 +2,7 @@ FILE /chainOfSafeCalls.kt
DUMMY C
FUN public fun test(/*0*/ nc: C?): C?
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
BLOCK type=C? operator=SAFE_CALL
VAR val tmp2_safe_receiver: C?
WHEN type=C? operator=SAFE_CALL
+4 -4
View File
@@ -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=<no-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=<no-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=<no-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=<no-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
+2 -2
View File
@@ -1,12 +1,12 @@
FILE /dotQualified.kt
FUN public fun length(/*0*/ s: kotlin.String): kotlin.Int
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CALL .<get-length> 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=<no-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
+8 -8
View File
@@ -4,11 +4,11 @@ FILE /elvis.kt
CONST Null type=kotlin.Nothing? value='null'
FUN public fun foo(): kotlin.Any?
BLOCK_BODY
RETURN type=<no-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=<no-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=<no-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=<no-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=<no-type>
then: RETURN type=kotlin.Nothing
CONST String type=kotlin.String value=''
RETURN type=<no-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=<no-type>
RETURN type=kotlin.Nothing
BLOCK type=kotlin.Any operator=ELVIS
VAR val tmp0_elvis_lhs: kotlin.Any?
CALL .<get-p> 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=<no-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
+3 -3
View File
@@ -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=<no-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=<no-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=<no-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
@@ -2,10 +2,10 @@ FILE /extensionPropertyGetterCall.kt
PROPERTY public val kotlin.String.okext: kotlin.String getter=<get-okext> setter=null
PROPERTY_GETTER public fun kotlin.String.<get-okext>(): kotlin.String property=okext
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CONST String type=kotlin.String value='OK'
FUN public fun kotlin.String.test5(): kotlin.String
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CALL .<get-okext> type=kotlin.String operator=GET_PROPERTY
$receiver: $RECEIVER of: test5 type=kotlin.String
+3 -3
View File
@@ -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=<no-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=<no-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=<no-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
+1 -1
View File
@@ -1,7 +1,7 @@
FILE /ifElseIf.kt
FUN public fun test(/*0*/ i: kotlin.Int): kotlin.Int
BLOCK_BODY
RETURN type=<no-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
+1 -1
View File
@@ -1,7 +1,7 @@
FILE /implicitCastOnPlatformType.kt
FUN public fun test(): kotlin.String
BLOCK_BODY
RETURN type=<no-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'
+4 -4
View File
@@ -1,26 +1,26 @@
FILE /in.kt
FUN public fun test1(/*0*/ a: kotlin.Any, /*1*/ x: kotlin.collections.Collection<kotlin.Any>): kotlin.Boolean
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CALL .contains type=kotlin.Boolean operator=IN
$this: GET_VAR x type=kotlin.collections.Collection<kotlin.Any> 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.Any>): kotlin.Boolean
BLOCK_BODY
RETURN type=<no-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<kotlin.Any> operator=null
element: GET_VAR a type=kotlin.Any operator=null
FUN public fun </*0*/ T> test3(/*0*/ a: T, /*1*/ x: kotlin.collections.Collection<T>): kotlin.Boolean
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CALL .contains type=kotlin.Boolean operator=IN
$this: GET_VAR x type=kotlin.collections.Collection<T> operator=null
element: GET_VAR a type=T operator=null
FUN public fun </*0*/ T> test4(/*0*/ a: T, /*1*/ x: kotlin.collections.Collection<T>): kotlin.Boolean
BLOCK_BODY
RETURN type=<no-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<T> operator=null
+4 -4
View File
@@ -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=<no-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=<no-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=<no-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=<no-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
+24 -24
View File
@@ -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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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
+7 -7
View File
@@ -8,33 +8,33 @@ FILE /references.kt
PROPERTY public val ok3: kotlin.String getter=<get-ok3> setter=null
PROPERTY_GETTER public fun <get-ok3>(): kotlin.String property=ok3
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CONST String type=kotlin.String value='OK'
FUN public fun test1(): kotlin.String
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CALL .<get-ok> type=kotlin.String operator=GET_PROPERTY
FUN public fun test2(/*0*/ x: kotlin.String): kotlin.String
BLOCK_BODY
RETURN type=<no-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=<no-type>
RETURN type=kotlin.Nothing
GET_VAR x type=kotlin.String operator=null
FUN public fun test4(): kotlin.String
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CALL .<get-ok3> type=kotlin.String operator=GET_PROPERTY
PROPERTY public val kotlin.String.okext: kotlin.String getter=<get-okext> setter=null
PROPERTY_GETTER public fun kotlin.String.<get-okext>(): kotlin.String property=okext
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CONST String type=kotlin.String value='OK'
FUN public fun kotlin.String.test5(): kotlin.String
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CALL .<get-okext> type=kotlin.String operator=GET_PROPERTY
$receiver: $RECEIVER of: test5 type=kotlin.String
@@ -3,13 +3,13 @@ FILE /safeCallWithIncrementDecrement.kt
PROPERTY public var test.C?.p: kotlin.Int getter=<get-p> setter=<set-p>
PROPERTY_GETTER public fun test.C?.<get-p>(): kotlin.Int property=p
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CONST Int type=kotlin.Int value='42'
PROPERTY_SETTER public fun test.C?.<set-p>(/*0*/ value: kotlin.Int): kotlin.Unit property=p
BLOCK_BODY
FUN public operator fun kotlin.Int?.inc(): kotlin.Int?
BLOCK_BODY
RETURN type=<no-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=<no-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
+4 -4
View File
@@ -3,7 +3,7 @@ FILE /safeCalls.kt
DUMMY IHost
FUN public fun test1(/*0*/ x: kotlin.String?): kotlin.Int?
BLOCK_BODY
RETURN type=<no-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=<no-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=<no-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
<set-?>: CONST Int type=kotlin.Int value='0'
FUN public fun IHost.test5(/*0*/ s: kotlin.String?): kotlin.Int?
BLOCK_BODY
RETURN type=<no-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
+11 -11
View File
@@ -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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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=<no-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
+6 -6
View File
@@ -1,31 +1,31 @@
FILE /simpleUnaryOperators.kt
FUN public fun test1(/*0*/ x: kotlin.Int): kotlin.Int
BLOCK_BODY
RETURN type=<no-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=<no-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=<no-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=<no-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=<no-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=<no-type>
RETURN type=kotlin.Nothing
CALL .not type=kotlin.Boolean operator=EXCL
$this: CONST Boolean type=kotlin.Boolean value='true'
+7 -7
View File
@@ -5,18 +5,18 @@ FILE /smartCasts.kt
BLOCK_BODY
FUN public fun overloaded(/*0*/ s: kotlin.String): kotlin.String
BLOCK_BODY
RETURN type=<no-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=<no-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=<no-type>
then: RETURN type=kotlin.Nothing
CALL .println type=kotlin.Unit operator=null
message: CALL .<get-length> 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=<no-type>
then: RETURN type=kotlin.Nothing
CONST String type=kotlin.String value=''
RETURN type=<no-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=<no-type>
then: RETURN type=kotlin.Nothing
CONST String type=kotlin.String value=''
RETURN type=<no-type>
RETURN type=kotlin.Nothing
TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR x type=kotlin.Any operator=null
@@ -3,18 +3,18 @@ FILE /smartCastsWithDestructuring.kt
DUMMY I2
FUN public operator fun I1.component1(): kotlin.Int
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CONST Int type=kotlin.Int value='1'
FUN public operator fun I2.component2(): kotlin.String
BLOCK_BODY
RETURN type=<no-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=<no-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)
+3 -3
View File
@@ -1,7 +1,7 @@
FILE /smoke.kt
FUN public fun testFun(): kotlin.String
BLOCK_BODY
RETURN type=<no-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=<get-testValWithGetter> setter=null
PROPERTY_GETTER public fun <get-testValWithGetter>(): kotlin.Int property=testValWithGetter
BLOCK_BODY
RETURN type=<no-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=<get-testVarWithAccessors> setter=<set-testVarWithAccessors>
PROPERTY_GETTER public fun <get-testVarWithAccessors>(): kotlin.Int property=testVarWithAccessors
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CONST Int type=kotlin.Int value='42'
PROPERTY_SETTER public fun <set-testVarWithAccessors>(/*0*/ v: kotlin.Int): kotlin.Unit property=testVarWithAccessors
BLOCK_BODY
+4 -4
View File
@@ -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=<no-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=<no-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=<no-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=<no-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
+3 -3
View File
@@ -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=<no-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=<no-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=<no-type>
RETURN type=kotlin.Nothing
STRING_CONCATENATION type=kotlin.String
GET_VAR a type=kotlin.String operator=null
CONST String type=kotlin.String value='+'
+2 -2
View File
@@ -1,7 +1,7 @@
FILE /throw.kt
FUN public fun test1(): kotlin.Unit
BLOCK_BODY
THROW type=<no-type>
THROW type=kotlin.Nothing
CALL .<init> 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=<no-type>
THROW type=kotlin.Nothing
TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.Throwable
GET_VAR a type=kotlin.Any operator=null
+1 -1
View File
@@ -10,7 +10,7 @@ FILE /tryCatch.kt
CALL .println type=kotlin.Unit operator=null
FUN public fun test2(): kotlin.Int
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
TRY_CATCH type=kotlin.Int
try: BLOCK type=kotlin.Int operator=null
CALL .println type=kotlin.Unit operator=null
+1 -1
View File
@@ -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=<no-type>
then: RETURN type=kotlin.Nothing
VAR val t: kotlin.String
TRY_CATCH type=kotlin.String
try: BLOCK type=kotlin.String operator=null
+4 -4
View File
@@ -2,21 +2,21 @@ FILE /typeOperators.kt
DUMMY IThing
FUN public fun test1(/*0*/ x: kotlin.Any): kotlin.Boolean
BLOCK_BODY
RETURN type=<no-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=<no-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=<no-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=<no-type>
RETURN type=kotlin.Nothing
TYPE_OP operator=SAFE_CAST typeOperand=IThing
GET_VAR x type=kotlin.Any operator=null
+4 -4
View File
@@ -7,17 +7,17 @@ FILE /values.kt
DUMMY Z
FUN public fun test1(): Enum
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
GET_ENUM_VALUE A type=Enum
FUN public fun test2(): A
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
GET_OBJECT A type=A
FUN public fun test3(): kotlin.Int
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
CALL .<get-a> type=kotlin.Int operator=GET_PROPERTY
FUN public fun test4(): Z.Companion
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
GET_OBJECT Companion type=Z.Companion
+5 -5
View File
@@ -1,28 +1,28 @@
FILE /variableAsFunctionCall.kt
FUN public fun kotlin.String.k(): () -> kotlin.String
BLOCK_BODY
RETURN type=<no-type>
RETURN type=kotlin.Nothing
DUMMY KtLambdaExpression type=() -> kotlin.String
FUN public fun test1(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
BLOCK_BODY
RETURN type=<no-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=<no-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=<no-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=<no-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
+3 -3
View File
@@ -2,7 +2,7 @@ FILE /when.kt
DUMMY A
FUN public fun testWithSubject(/*0*/ x: kotlin.Any?): kotlin.String
BLOCK_BODY
RETURN type=<no-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=<no-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=<no-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
+4 -4
View File
@@ -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=<no-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=<no-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=<no-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=<no-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