[FIR] add vararg arguments support, improve vararg parameters support

This commit is contained in:
Juan Chen
2020-01-27 19:51:35 -08:00
committed by Mikhail Glukhikh
parent 069fbffaa3
commit 188abc243a
75 changed files with 339 additions and 207 deletions
@@ -59,7 +59,7 @@ fun ConeKotlinType.toIrType(
return when (this) {
is ConeKotlinErrorType -> createErrorType()
is ConeLookupTagBasedType -> {
val irSymbol = getPrimitiveArrayType(this.classId, irBuiltIns) ?: run {
val irSymbol = getArrayType(this.classId, irBuiltIns) ?: run {
val firSymbol = this.lookupTag.toSymbol(session) ?: return createErrorType()
firSymbol.toIrSymbol(session, declarationStorage)
}
@@ -87,8 +87,9 @@ fun ConeKotlinType.toIrType(
}
}
private fun getPrimitiveArrayType(classId: ClassId?, irBuiltIns: IrBuiltIns): IrClassifierSymbol? {
private fun getArrayType(classId: ClassId?, irBuiltIns: IrBuiltIns): IrClassifierSymbol? {
val irType = when (classId) {
ClassId(FqName("kotlin"), FqName("Array"), false) -> return irBuiltIns.arrayClass
ClassId(FqName("kotlin"), FqName("BooleanArray"), false) -> irBuiltIns.booleanType
ClassId(FqName("kotlin"), FqName("ByteArray"), false) -> irBuiltIns.byteType
ClassId(FqName("kotlin"), FqName("CharArray"), false) -> irBuiltIns.charType
@@ -23,7 +23,10 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol
import org.jetbrains.kotlin.fir.types.ConeKotlinType
import org.jetbrains.kotlin.fir.types.FirTypeRef
import org.jetbrains.kotlin.fir.types.arrayElementType
import org.jetbrains.kotlin.fir.types.coneTypeSafe
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.declarations.impl.*
@@ -686,7 +689,9 @@ class Fir2IrDeclarationStorage(
IrValueParameterImpl(
startOffset, endOffset, origin, symbol,
valueParameter.name, index, type,
null, valueParameter.isCrossinline, valueParameter.isNoinline
if (!valueParameter.isVararg) null
else valueParameter.returnTypeRef.coneTypeSafe<ConeKotlinType>()?.arrayElementType(session)?.toIrType(session, this, irBuiltIns),
valueParameter.isCrossinline, valueParameter.isNoinline
).apply {
descriptor.bind(this)
if (valueParameter.defaultValue != null) {
@@ -33,6 +33,7 @@ import org.jetbrains.kotlin.fir.visitors.FirDefaultVisitor
import org.jetbrains.kotlin.fir.visitors.transformSingle
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
import org.jetbrains.kotlin.ir.builders.*
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.declarations.impl.IrFieldImpl
@@ -674,6 +675,18 @@ class Fir2IrVisitor(
return wrappedArgumentExpression.expression.toIrExpression()
}
override fun visitVarargArgumentsExpression(varargArgumentsExpression: FirVarargArgumentsExpression, data: Any?): IrElement {
val irReturnType = varargArgumentsExpression.typeRef.toIrType(session, declarationStorage)
return IrVarargImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, irReturnType,
varargArgumentsExpression.varargElementType.toIrType(session, declarationStorage),
varargArgumentsExpression.arguments.map { arg ->
arg.toIrExpression().run {
if (arg is FirSpreadArgumentExpression) IrSpreadElementImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, this)
else this
}
})
}
private fun FirReference.statementOrigin(): IrStatementOrigin? {
return when (this) {
is FirPropertyFromParameterResolvedNamedReference -> IrStatementOrigin.INITIALIZE_PROPERTY_FROM_PARAMETER
@@ -9,6 +9,8 @@ import org.jetbrains.kotlin.fir.*
import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.diagnostics.FirSimpleDiagnostic
import org.jetbrains.kotlin.fir.expressions.*
import org.jetbrains.kotlin.fir.expressions.impl.FirFunctionCallImpl
import org.jetbrains.kotlin.fir.expressions.impl.FirVarargArgumentsExpressionImpl
import org.jetbrains.kotlin.fir.references.impl.FirResolvedCallableReferenceImpl
import org.jetbrains.kotlin.fir.references.impl.FirResolvedNamedReferenceImpl
import org.jetbrains.kotlin.fir.resolve.calls.Candidate
@@ -32,6 +34,7 @@ import org.jetbrains.kotlin.fir.visitors.transformSingle
import org.jetbrains.kotlin.types.AbstractTypeApproximator
import org.jetbrains.kotlin.types.TypeApproximatorConfiguration
import org.jetbrains.kotlin.types.Variance
import java.lang.Math.min
class FirCallCompletionResultsWriterTransformer(
override val session: FirSession,
@@ -189,7 +192,36 @@ class FirCallCompletionResultsWriterTransformer(
}
else -> {
resultType = typeRef.substituteTypeRef(subCandidate)
result.transformArguments(this, subCandidate.createArgumentsMapping()).transformExplicitReceiver(integerApproximator, null)
val vararg = subCandidate.argumentMapping?.values?.firstOrNull { it.isVararg }
result.transformArguments(this, subCandidate.createArgumentsMapping()).apply {
if (vararg != null && this is FirFunctionCallImpl) {
// Create a FirVarargArgumentExpression for the vararg arguments
val resolvedArrayType = vararg.returnTypeRef.substitute(subCandidate)
val resolvedElementType = resolvedArrayType.arrayElementType(session)
val varargArgument = FirVarargArgumentsExpressionImpl(
null,
vararg.returnTypeRef.withReplacedConeType(resolvedElementType)
)
varargArgument.replaceTypeRef(
vararg.returnTypeRef.withReplacedConeType(
vararg.returnTypeRef.substitute(
subCandidate
)
)
)
var firstIndex = arguments.size
for ((i, arg) in arguments.withIndex()) {
if (subCandidate.argumentMapping!![arg]?.isVararg ?: false) {
firstIndex = min(firstIndex, i)
varargArgument.arguments.add(arg)
}
}
for (arg in varargArgument.arguments) {
arguments.remove(arg)
}
arguments.add(firstIndex, varargArgument)
}
}.transformExplicitReceiver(integerApproximator, null)
}
}
@@ -199,14 +231,16 @@ class FirCallCompletionResultsWriterTransformer(
).compose()
}
private fun FirTypeRef.substitute(candidate: Candidate): ConeKotlinType =
coneTypeUnsafe<ConeKotlinType>()
.let { candidate.substitutor.substituteOrSelf(it) }
.let { finalSubstitutor.substituteOrSelf(it) }
private fun Candidate.createArgumentsMapping(): ExpectedArgumentType? {
return argumentMapping?.map { (argument, valueParameter) ->
val expectedType = valueParameter.returnTypeRef.coneTypeUnsafe<ConeKotlinType>()
.let { substitutor.substituteOrSelf(it) }
.let { finalSubstitutor.substituteOrSelf(it) }
argument.expandArgument() to expectedType
}
val expectedType = valueParameter.returnTypeRef.substitute(this)
argument.unwrapArgument() to expectedType
}
?.toMap()?.toExpectedType()
}
@@ -330,7 +364,7 @@ private fun ExpectedArgumentType.getExpectedType(argument: FirExpression): ConeK
private fun Map<FirExpression, ConeKotlinType>.toExpectedType(): ExpectedArgumentType = ExpectedArgumentType.ArgumentsMap(this)
fun ConeKotlinType.toExpectedType(): ExpectedArgumentType = ExpectedArgumentType.ExpectedType(this)
private fun FirExpression.expandArgument(): FirExpression = when (this) {
private fun FirExpression.unwrapArgument(): FirExpression = when (this) {
is FirWrappedArgumentExpression -> expression
else -> this
}
@@ -122,7 +122,8 @@ class FirSyntheticCallGenerator(
)
val fakeCallElement = FirFunctionCallImpl(null).copy(calleeReference = reference, arguments = arguments)
return callCompleter.completeCall(fakeCallElement, expectedTypeRef).arguments[0] as FirCallableReferenceAccess?
val argument = callCompleter.completeCall(fakeCallElement, expectedTypeRef).arguments[0]
return ((argument as? FirVarargArgumentsExpression)?.arguments?.get(0) ?: argument) as FirCallableReferenceAccess?
}
private fun generateCalleeReferenceWithCandidate(
@@ -17,7 +17,7 @@ FILE: default.kt
R|/bar|(Int(1), Double(2.0), Boolean(true), String(my))
<Inapplicable(PARAMETER_MAPPING_ERROR): [/bar]>#(Int(1), Boolean(true))
R|/baz|(Int(1))
R|/baz|(Int(1), String(my), String(yours))
R|/baz|(Int(1), vararg(String(my), String(yours)))
R|/baz|(Int(1), z = Boolean(true))
<Inapplicable(INAPPLICABLE): [/baz]>#(Int(0), String(), Boolean(false))
}
+4 -4
View File
@@ -5,12 +5,12 @@ FILE: vararg.kt
}
public final fun test(): R|kotlin/Unit| {
R|/foo|(Int(1))
R|/foo|(Int(1), String())
R|/foo|(Int(1), String(my), String(yours))
R|/foo|(Int(1), *R|kotlin/arrayOf|<R|kotlin/String|>(String(my), String(yours)))
R|/foo|(Int(1), vararg(String()))
R|/foo|(Int(1), vararg(String(my), String(yours)))
R|/foo|(Int(1), vararg(*R|kotlin/arrayOf|<R|kotlin/String|>(vararg(String(my), String(yours)))))
<Inapplicable(INAPPLICABLE): [/foo]>#(String())
<Inapplicable(INAPPLICABLE): [/foo]>#(Int(1), Int(2))
R|/bar|(Int(1), z = Boolean(true), y = *R|kotlin/arrayOf|<R|kotlin/String|>(String(my), String(yours)))
R|/bar|(Int(1), z = Boolean(true), vararg(y = *R|kotlin/arrayOf|<R|kotlin/String|>(vararg(String(my), String(yours)))))
<Inapplicable(PARAMETER_MAPPING_ERROR): [/bar]>#(Int(0), z = Boolean(false), y = String(), y = String(other))
<Inapplicable(PARAMETER_MAPPING_ERROR): [/bar]>#(Int(0), String(), Boolean(true))
}
@@ -2,8 +2,8 @@ FILE: postponedLambdas.kt
public final inline fun foo(vararg x: R|kotlin/Array<kotlin/Any>|): R|kotlin/Unit| {
}
public final fun test(a: R|kotlin/Any|, b: R|kotlin/Any|, c: R|kotlin/Any|): R|kotlin/Unit| {
R|/foo|(R|<local>/a|, foo@fun <anonymous>(): R|kotlin/String| <kind=UNKNOWN> {
R|/foo|(vararg(R|<local>/a|, R|<local>/b|), foo@fun <anonymous>(): R|kotlin/String| <kind=UNKNOWN> {
String()
}
, R|<local>/b|)
)
}
@@ -45,6 +45,6 @@ FILE: enumEntryUse.kt
R|/use|(Q|TestEnum|.R|/TestEnum.FIRST|)
R|/useEnum|(Q|TestEnum|.R|/TestEnum.SECOND|)
R|/useEnum|(Q|TestEnum|.R|/TestEnum.THIRD|)
R|/useVararg|(Q|TestEnum|.R|/TestEnum.FIRST|, Q|TestEnum|.R|/TestEnum.SECOND|)
R|/useVararg|(vararg(Q|TestEnum|.R|/TestEnum.FIRST|, Q|TestEnum|.R|/TestEnum.SECOND|))
<Inapplicable(INAPPLICABLE): [/useVararg]>#(Int(1), Int(2), Int(3), Int(4), Int(5))
}
@@ -5,5 +5,5 @@ FILE: vararg.kt
}
public final fun main(): R|kotlin/Unit| {
R|/foo|()
R|/foo|(String(!))
R|/foo|(vararg(String(!)))
}
+1 -1
View File
@@ -61,7 +61,7 @@ FILE: problems2.kt
}
public final fun test(): R|kotlin/Unit| {
Q|Some|.R|/Some.WithPrimary.WithPrimary|(Int(42), R|kotlin/arrayOf|<R|kotlin/String|>(String(alpha), String(omega)))
Q|Some|.R|/Some.WithPrimary.WithPrimary|(Int(42), R|kotlin/arrayOf|<R|kotlin/String|>(vararg(String(alpha), String(omega))))
}
public final class KonanTarget : R|kotlin/Any| {
public constructor(name: R|kotlin/String|): R|KonanTarget| {
@@ -1,6 +1,6 @@
FILE: addAllOnJavaCollection.kt
public final fun foo(): R|kotlin/Unit| {
lval y: R|kotlin/collections/List<kotlin/String>| = R|kotlin/collections/listOf|<R|kotlin/String|>(String(Alpha), String(Beta))
lval y: R|kotlin/collections/List<kotlin/String>| = R|kotlin/collections/listOf|<R|kotlin/String|>(vararg(String(Alpha), String(Beta)))
lval x: R|java/util/LinkedHashSet<kotlin/String>| = R|java/util/LinkedHashSet.LinkedHashSet|<R|kotlin/String|>().R|kotlin/apply|<R|java/util/LinkedHashSet<kotlin/String>|>(<L> = apply@fun R|java/util/LinkedHashSet<kotlin/String>|.<anonymous>(): R|kotlin/Unit| <kind=EXACTLY_ONCE> {
this@R|special/anonymous|.R|FakeOverride<java/util/AbstractCollection.addAll: R|kotlin/Boolean|>|(R|<local>/y|)
}
@@ -4,5 +4,5 @@ FILE: arrayInLocal.kt
^convert R|<local>/paths|.R|kotlin/collections/toList|<R|kotlin/String|>().R|kotlin/collections/toTypedArray|<R|kotlin/String|>()
}
R|<local>/convert|(String(1), String(2), String(3))
R|<local>/convert|(vararg(String(1), String(2), String(3)))
}
@@ -1,5 +1,5 @@
FILE: backingField.kt
public final var myProperty: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(1), Int(2), Int(3))
public final var myProperty: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(vararg(Int(1), Int(2), Int(3)))
public get(): R|kotlin/collections/List<kotlin/Int>| {
^ F|/myProperty|.R|kotlin/collections/plus|<R|kotlin/Int|>(F|/myProperty|)
}
@@ -7,31 +7,31 @@ FILE: topLevelResolve.kt
lval c: R|kotlin/Char| = Char(a).R|kotlin/Char.plus|(Int(1))
lval s: R|kotlin/String| = String(.).R|kotlin/String.plus|(String(..))
lval ss: R|kotlin/String| = String().R|kotlin/String.plus|(Int(1))
lval list: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(1), Int(2), Int(3)).R|kotlin/collections/plus|<R|kotlin/Int|>(Int(4))
lval listAndList: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(4), Int(5), Int(6)).R|kotlin/collections/plus|<R|kotlin/Int|>(R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(7), Int(8)))
lval mutableList: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/mutableListOf|<R|kotlin/Int|>(Int(9), Int(10)).R|kotlin/collections/plus|<R|kotlin/Int|>(R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(11), Int(12), Int(13)))
lval setAndList: R|kotlin/collections/Set<kotlin/Int>| = R|kotlin/collections/setOf|<R|kotlin/Int|>(Int(0)).R|kotlin/collections/plus|<R|kotlin/Int|>(R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(1), Int(2)))
lval list: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(vararg(Int(1), Int(2), Int(3))).R|kotlin/collections/plus|<R|kotlin/Int|>(Int(4))
lval listAndList: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(vararg(Int(4), Int(5), Int(6))).R|kotlin/collections/plus|<R|kotlin/Int|>(R|kotlin/collections/listOf|<R|kotlin/Int|>(vararg(Int(7), Int(8))))
lval mutableList: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/mutableListOf|<R|kotlin/Int|>(vararg(Int(9), Int(10))).R|kotlin/collections/plus|<R|kotlin/Int|>(R|kotlin/collections/listOf|<R|kotlin/Int|>(vararg(Int(11), Int(12), Int(13))))
lval setAndList: R|kotlin/collections/Set<kotlin/Int>| = R|kotlin/collections/setOf|<R|kotlin/Int|>(Int(0)).R|kotlin/collections/plus|<R|kotlin/Int|>(R|kotlin/collections/listOf|<R|kotlin/Int|>(vararg(Int(1), Int(2))))
lval stringAndList: R|kotlin/String| = String().R|kotlin/String.plus|(R|kotlin/collections/emptyList|<R|kotlin/Boolean|>())
lval map: R|kotlin/collections/Map<kotlin/String, kotlin/Int>| = R|kotlin/collections/mapOf|<R|kotlin/String|, R|kotlin/Int|>(String().R|kotlin/to|<R|kotlin/String|, R|kotlin/Int|>(Int(1)), String(.).R|kotlin/to|<R|kotlin/String|, R|kotlin/Int|>(Int(2))).R|kotlin/collections/plus|<R|kotlin/String|, R|kotlin/Int|>(String(..).R|kotlin/to|<R|kotlin/String|, R|kotlin/Int|>(Int(3)))
lval map: R|kotlin/collections/Map<kotlin/String, kotlin/Int>| = R|kotlin/collections/mapOf|<R|kotlin/String|, R|kotlin/Int|>(String().R|kotlin/to|<R|kotlin/String|, R|kotlin/Int|>(Int(1)), String(.).R|kotlin/to|<R|kotlin/String|, R|kotlin/Int|>(Int(2)), vararg()).R|kotlin/collections/plus|<R|kotlin/String|, R|kotlin/Int|>(String(..).R|kotlin/to|<R|kotlin/String|, R|kotlin/Int|>(Int(3)))
lval mapAndMap: R|kotlin/collections/Map<kotlin/String, kotlin/Int>| = R|kotlin/collections/mapOf|<R|kotlin/String|, R|kotlin/Int|>(String(-).R|kotlin/to|<R|kotlin/String|, R|kotlin/Int|>(Int(4))).R|kotlin/collections/plus|<R|kotlin/String|, R|kotlin/Int|>(R|kotlin/collections/mapOf|<R|kotlin/String|, R|kotlin/Int|>(String(_).R|kotlin/to|<R|kotlin/String|, R|kotlin/Int|>(Int(5))))
}
public final fun <T> id(arg: R|T|): R|T| {
^id R|<local>/arg|
}
public final fun testMap(): R|kotlin/Unit| {
lval first: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(1), Int(2), Int(3)).R|kotlin/collections/map|<R|kotlin/Int|, R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Int| <kind=UNKNOWN> {
lval first: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(vararg(Int(1), Int(2), Int(3))).R|kotlin/collections/map|<R|kotlin/Int|, R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Int| <kind=UNKNOWN> {
R|<local>/it|.R|kotlin/Int.times|(Int(2))
}
)
lval second: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/intArrayOf|(Int(4), Int(5), Int(6)).R|kotlin/collections/map|<R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Int| <kind=UNKNOWN> {
lval second: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/intArrayOf|(vararg(Int(4), Int(5), Int(6))).R|kotlin/collections/map|<R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Int| <kind=UNKNOWN> {
R|<local>/it|.R|kotlin/Int.times|(Int(2))
}
)
lval withId: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(1), Int(2), Int(3)).R|kotlin/collections/map|<R|kotlin/Int|, R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Int| <kind=UNKNOWN> {
lval withId: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(vararg(Int(1), Int(2), Int(3))).R|kotlin/collections/map|<R|kotlin/Int|, R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Int| <kind=UNKNOWN> {
R|/id|<R|kotlin/Int|>(R|<local>/it|)
}
)
lval stringToInt: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/String|>(String(alpha), String(omega)).R|kotlin/collections/map|<R|kotlin/String|, R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/String|): R|kotlin/Int| <kind=UNKNOWN> {
lval stringToInt: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/String|>(vararg(String(alpha), String(omega))).R|kotlin/collections/map|<R|kotlin/String|, R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/String|): R|kotlin/Int| <kind=UNKNOWN> {
R|<local>/it|.R|kotlin/String.length|
}
)
@@ -0,0 +1,26 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.fir.expressions
import org.jetbrains.kotlin.fir.FirPureAbstractElement
import org.jetbrains.kotlin.fir.FirSourceElement
import org.jetbrains.kotlin.fir.types.FirTypeRef
import org.jetbrains.kotlin.fir.visitors.*
/*
* This file was generated automatically
* DO NOT MODIFY IT MANUALLY
*/
abstract class FirVarargArgumentsExpression : FirPureAbstractElement(), FirExpression {
abstract override val source: FirSourceElement?
abstract override val typeRef: FirTypeRef
abstract override val annotations: List<FirAnnotationCall>
abstract val arguments: List<FirExpression>
abstract val varargElementType: FirTypeRef
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitVarargArgumentsExpression(this, data)
}
@@ -0,0 +1,48 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.fir.expressions.impl
import org.jetbrains.kotlin.fir.FirSourceElement
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
import org.jetbrains.kotlin.fir.expressions.FirExpression
import org.jetbrains.kotlin.fir.expressions.FirVarargArgumentsExpression
import org.jetbrains.kotlin.fir.impl.FirAbstractAnnotatedElement
import org.jetbrains.kotlin.fir.types.FirTypeRef
import org.jetbrains.kotlin.fir.types.impl.FirImplicitTypeRefImpl
import org.jetbrains.kotlin.fir.visitors.*
/*
* This file was generated automatically
* DO NOT MODIFY IT MANUALLY
*/
class FirVarargArgumentsExpressionImpl(
override val source: FirSourceElement?,
override var varargElementType: FirTypeRef
) : FirVarargArgumentsExpression(), FirAbstractAnnotatedElement {
override var typeRef: FirTypeRef = FirImplicitTypeRefImpl(null)
override val annotations: MutableList<FirAnnotationCall> = mutableListOf()
override val arguments: MutableList<FirExpression> = mutableListOf()
override fun <R, D> acceptChildren(visitor: FirVisitor<R, D>, data: D) {
typeRef.accept(visitor, data)
annotations.forEach { it.accept(visitor, data) }
arguments.forEach { it.accept(visitor, data) }
varargElementType.accept(visitor, data)
}
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirVarargArgumentsExpressionImpl {
typeRef = typeRef.transformSingle(transformer, data)
annotations.transformInplace(transformer, data)
arguments.transformInplace(transformer, data)
varargElementType = varargElementType.transformSingle(transformer, data)
return this
}
override fun replaceTypeRef(newTypeRef: FirTypeRef) {
typeRef = newTypeRef
}
}
@@ -92,6 +92,7 @@ import org.jetbrains.kotlin.fir.expressions.FirWrappedArgumentExpression
import org.jetbrains.kotlin.fir.expressions.FirLambdaArgumentExpression
import org.jetbrains.kotlin.fir.expressions.FirSpreadArgumentExpression
import org.jetbrains.kotlin.fir.expressions.FirNamedArgumentExpression
import org.jetbrains.kotlin.fir.expressions.FirVarargArgumentsExpression
import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
import org.jetbrains.kotlin.fir.expressions.FirResolvedReifiedParameterReference
import org.jetbrains.kotlin.fir.expressions.FirReturnExpression
@@ -474,6 +475,10 @@ abstract class FirTransformer<in D> : FirVisitor<CompositeTransformResult<FirEle
return transformElement(namedArgumentExpression, data)
}
open fun transformVarargArgumentsExpression(varargArgumentsExpression: FirVarargArgumentsExpression, data: D): CompositeTransformResult<FirStatement> {
return transformElement(varargArgumentsExpression, data)
}
open fun transformResolvedQualifier(resolvedQualifier: FirResolvedQualifier, data: D): CompositeTransformResult<FirStatement> {
return transformElement(resolvedQualifier, data)
}
@@ -930,6 +935,10 @@ abstract class FirTransformer<in D> : FirVisitor<CompositeTransformResult<FirEle
return transformNamedArgumentExpression(namedArgumentExpression, data)
}
final override fun visitVarargArgumentsExpression(varargArgumentsExpression: FirVarargArgumentsExpression, data: D): CompositeTransformResult<FirStatement> {
return transformVarargArgumentsExpression(varargArgumentsExpression, data)
}
final override fun visitResolvedQualifier(resolvedQualifier: FirResolvedQualifier, data: D): CompositeTransformResult<FirStatement> {
return transformResolvedQualifier(resolvedQualifier, data)
}
@@ -92,6 +92,7 @@ import org.jetbrains.kotlin.fir.expressions.FirWrappedArgumentExpression
import org.jetbrains.kotlin.fir.expressions.FirLambdaArgumentExpression
import org.jetbrains.kotlin.fir.expressions.FirSpreadArgumentExpression
import org.jetbrains.kotlin.fir.expressions.FirNamedArgumentExpression
import org.jetbrains.kotlin.fir.expressions.FirVarargArgumentsExpression
import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
import org.jetbrains.kotlin.fir.expressions.FirResolvedReifiedParameterReference
import org.jetbrains.kotlin.fir.expressions.FirReturnExpression
@@ -300,6 +301,8 @@ abstract class FirVisitor<out R, in D> {
open fun visitNamedArgumentExpression(namedArgumentExpression: FirNamedArgumentExpression, data: D): R = visitElement(namedArgumentExpression, data)
open fun visitVarargArgumentsExpression(varargArgumentsExpression: FirVarargArgumentsExpression, data: D): R = visitElement(varargArgumentsExpression, data)
open fun visitResolvedQualifier(resolvedQualifier: FirResolvedQualifier, data: D): R = visitElement(resolvedQualifier, data)
open fun visitResolvedReifiedParameterReference(resolvedReifiedParameterReference: FirResolvedReifiedParameterReference, data: D): R = visitElement(resolvedReifiedParameterReference, data)
@@ -92,6 +92,7 @@ import org.jetbrains.kotlin.fir.expressions.FirWrappedArgumentExpression
import org.jetbrains.kotlin.fir.expressions.FirLambdaArgumentExpression
import org.jetbrains.kotlin.fir.expressions.FirSpreadArgumentExpression
import org.jetbrains.kotlin.fir.expressions.FirNamedArgumentExpression
import org.jetbrains.kotlin.fir.expressions.FirVarargArgumentsExpression
import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
import org.jetbrains.kotlin.fir.expressions.FirResolvedReifiedParameterReference
import org.jetbrains.kotlin.fir.expressions.FirReturnExpression
@@ -472,6 +473,10 @@ abstract class FirVisitorVoid : FirVisitor<Unit, Nothing?>() {
visitElement(namedArgumentExpression)
}
open fun visitVarargArgumentsExpression(varargArgumentsExpression: FirVarargArgumentsExpression) {
visitElement(varargArgumentsExpression)
}
open fun visitResolvedQualifier(resolvedQualifier: FirResolvedQualifier) {
visitElement(resolvedQualifier)
}
@@ -928,6 +933,10 @@ abstract class FirVisitorVoid : FirVisitor<Unit, Nothing?>() {
visitNamedArgumentExpression(namedArgumentExpression)
}
final override fun visitVarargArgumentsExpression(varargArgumentsExpression: FirVarargArgumentsExpression, data: Nothing?) {
visitVarargArgumentsExpression(varargArgumentsExpression)
}
final override fun visitResolvedQualifier(resolvedQualifier: FirResolvedQualifier, data: Nothing?) {
visitResolvedQualifier(resolvedQualifier)
}
@@ -659,6 +659,12 @@ class FirRenderer(builder: StringBuilder) : FirVisitorVoid() {
lambdaArgumentExpression.expression.accept(this)
}
override fun visitVarargArgumentsExpression(varargArgumentsExpression: FirVarargArgumentsExpression) {
print("vararg(")
varargArgumentsExpression.arguments.renderSeparated()
print(")")
}
override fun visitCall(call: FirCall) {
print("(")
call.arguments.renderSeparated()
@@ -107,6 +107,7 @@ object FirTreeBuilder : AbstractFirTreeBuilder() {
val lambdaArgumentExpression = element("LambdaArgumentExpression", Expression, wrappedArgumentExpression)
val spreadArgumentExpression = element("SpreadArgumentExpression", Expression, wrappedArgumentExpression)
val namedArgumentExpression = element("NamedArgumentExpression", Expression, wrappedArgumentExpression)
val varargArgumentsExpression = element("VarargArgumentsExpression", Expression, expression)
val resolvedQualifier = element("ResolvedQualifier", Expression, expression)
val resolvedReifiedParameterReference = element("ResolvedReifiedParameterReference", Expression, expression)
@@ -426,6 +426,11 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
+name
}
varargArgumentsExpression.configure {
+fieldList("arguments", expression)
+field("varargElementType", typeRef)
}
resolvedQualifier.configure {
+field("packageFqName", fqNameType)
+field("relativeClassFqName", fqNameType, nullable = true)
@@ -102,17 +102,20 @@ private class VarargLowering(val context: JvmBackendContext) : FileLoweringPass,
context.createJvmIrBuilder(currentScope!!.scope.scopeOwnerSymbol, startOffset, endOffset)
private val IrFunctionSymbol.isArrayOf: Boolean
get() = this == context.ir.symbols.arrayOf || owner.isPrimitiveArrayOf
get() = owner.isArrayOf
private val IrFunctionSymbol.isEmptyArray: Boolean
get() = owner.name.asString() == "emptyArray" && (owner.parent as? IrPackageFragment)?.fqName == KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME
get() = owner.name.asString() == "emptyArray" &&
(owner.parent as? IrPackageFragment)?.fqName == KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME
companion object {
private val PRIMITIVE_ARRAY_OF_NAMES: Set<String> =
(PrimitiveType.values().map { type -> type.name } + UnsignedType.values().map { type -> type.typeName.asString() })
.map { name -> name.toLowerCaseAsciiOnly() + "ArrayOf" }.toSet()
private const val ARRAY_OF_NAME = "arrayOf"
private val IrFunction.isPrimitiveArrayOf: Boolean
private val IrFunction.isArrayOf: Boolean
get() {
val parent = when (val directParent = parent) {
is IrClass -> directParent.getPackageFragment() ?: return false
@@ -120,7 +123,7 @@ private class VarargLowering(val context: JvmBackendContext) : FileLoweringPass,
else -> return false
}
return parent.fqName == KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME &&
name.asString() in PRIMITIVE_ARRAY_OF_NAMES &&
name.asString().let { it in PRIMITIVE_ARRAY_OF_NAMES || it == ARRAY_OF_NAME } &&
extensionReceiverParameter == null &&
dispatchReceiverParameter == null &&
valueParameters.size == 1 &&
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
//test [], get and iterator calls
fun test(createIntNotLong: Boolean): String {
val a = if (createIntNotLong) IntArray(5) else LongArray(5)
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
operator fun String.get(vararg value: Any) : String {
return if (value[0] == 44 && value[1] == "example") "OK" else "fail"
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
val array = intArrayOf(11, 12, 13)
val p = array.get(0)
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun test(b: Boolean): String {
val a = if (b) IntArray(5) else LongArray(5)
if (a is IntArray) {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// FILE: AT.java
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
var xs = intArrayOf(1, 2, 3)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// See https://youtrack.jetbrains.com/issue/KT-21354
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
testForInFloatArrayWithUpcastToAny()
testForInDoubleArrayWithUpcastToAny()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
var xs: IntArray = intArrayOf(1, 2, 3)
get() = field
set(ys) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
data class A(val a: IntArray, var b: Array<String>)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class C {
fun calc() : String {
return "OK"
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class A<T>(t: Array<Array<T>>) {
val a:Array<Array<T>> = t
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
A()
return "OK"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
open class A(val array: Array<Any>)
class B : A(arrayOf("OK"))
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// FULL_JDK
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: emptyVarargOfBoxedPrimitiveType.kt
fun box(): String {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun aa(vararg a : String): String = a[0]
fun box(): String {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
operator fun <T> Array<T>?.get(i : Int?) = this!!.get(i!!)
fun <T> array(vararg t : T) : Array<T> = t as Array<T>
@@ -88,11 +88,11 @@ FILE fqName:<root> fileName:/annotationClasses.kt
CLASS ANNOTATION_CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Annotation]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test4
CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:<root>.Test4 [primary]
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
PROPERTY name:xs visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array<out kotlin.Int> visibility:private [final]
EXPRESSION_BODY
GET_VAR 'xs: kotlin.IntArray declared in <root>.Test4.<init>' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER
GET_VAR 'xs: kotlin.IntArray [vararg] declared in <root>.Test4.<init>' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xs> visibility:public modality:FINAL <> ($this:<root>.Test4) returnType:kotlin.Array<out kotlin.Int>
correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Test4
@@ -2,11 +2,11 @@ FILE fqName:<root> fileName:/annotationsWithVarargParameters.kt
CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
CONSTRUCTOR visibility:public <> (xs:kotlin.Array<kotlin.String>) returnType:<root>.A [primary]
VALUE_PARAMETER name:xs index:0 type:kotlin.Array<kotlin.String>
VALUE_PARAMETER name:xs index:0 type:kotlin.Array<kotlin.String> varargElementType:kotlin.String [vararg]
PROPERTY name:xs visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array<out kotlin.String> visibility:private [final]
EXPRESSION_BODY
GET_VAR 'xs: kotlin.Array<kotlin.String> declared in <root>.A.<init>' type=kotlin.Array<kotlin.String> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
GET_VAR 'xs: kotlin.Array<kotlin.String> [vararg] declared in <root>.A.<init>' type=kotlin.Array<kotlin.String> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xs> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Array<out kotlin.String>
correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A
@@ -2,11 +2,11 @@ FILE fqName:<root> fileName:/spreadOperatorInAnnotationArguments.kt
CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
CONSTRUCTOR visibility:public <> (xs:kotlin.Array<kotlin.String>) returnType:<root>.A [primary]
VALUE_PARAMETER name:xs index:0 type:kotlin.Array<kotlin.String>
VALUE_PARAMETER name:xs index:0 type:kotlin.Array<kotlin.String> varargElementType:kotlin.String [vararg]
PROPERTY name:xs visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array<out kotlin.String> visibility:private [final]
EXPRESSION_BODY
GET_VAR 'xs: kotlin.Array<kotlin.String> declared in <root>.A.<init>' type=kotlin.Array<kotlin.String> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
GET_VAR 'xs: kotlin.Array<kotlin.String> [vararg] declared in <root>.A.<init>' type=kotlin.Array<kotlin.String> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xs> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Array<out kotlin.String>
correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A
@@ -2,11 +2,11 @@ FILE fqName:<root> fileName:/varargsInAnnotationArguments.kt
CLASS ANNOTATION_CLASS name:A1 modality:FINAL visibility:public superTypes:[kotlin.Annotation]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A1
CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:<root>.A1 [primary]
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
PROPERTY name:xs visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array<out kotlin.Int> visibility:private [final]
EXPRESSION_BODY
GET_VAR 'xs: kotlin.IntArray declared in <root>.A1.<init>' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER
GET_VAR 'xs: kotlin.IntArray [vararg] declared in <root>.A1.<init>' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xs> visibility:public modality:FINAL <> ($this:<root>.A1) returnType:kotlin.Array<out kotlin.Int>
correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A1
@@ -30,11 +30,11 @@ FILE fqName:<root> fileName:/varargsInAnnotationArguments.kt
CLASS ANNOTATION_CLASS name:A2 modality:FINAL visibility:public superTypes:[kotlin.Annotation]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A2
CONSTRUCTOR visibility:public <> (xs:kotlin.Array<kotlin.String>) returnType:<root>.A2 [primary]
VALUE_PARAMETER name:xs index:0 type:kotlin.Array<kotlin.String>
VALUE_PARAMETER name:xs index:0 type:kotlin.Array<kotlin.String> varargElementType:kotlin.String [vararg]
PROPERTY name:xs visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array<out kotlin.String> visibility:private [final]
EXPRESSION_BODY
GET_VAR 'xs: kotlin.Array<kotlin.String> declared in <root>.A2.<init>' type=kotlin.Array<kotlin.String> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
GET_VAR 'xs: kotlin.Array<kotlin.String> [vararg] declared in <root>.A2.<init>' type=kotlin.Array<kotlin.String> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xs> visibility:public modality:FINAL <> ($this:<root>.A2) returnType:kotlin.Array<out kotlin.String>
correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A2
@@ -58,11 +58,11 @@ FILE fqName:<root> fileName:/varargsInAnnotationArguments.kt
CLASS ANNOTATION_CLASS name:AA modality:FINAL visibility:public superTypes:[kotlin.Annotation]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.AA
CONSTRUCTOR visibility:public <> (xs:kotlin.Array<<root>.A1>) returnType:<root>.AA [primary]
VALUE_PARAMETER name:xs index:0 type:kotlin.Array<<root>.A1>
VALUE_PARAMETER name:xs index:0 type:kotlin.Array<<root>.A1> varargElementType:<root>.A1 [vararg]
PROPERTY name:xs visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array<out <root>.A1> visibility:private [final]
EXPRESSION_BODY
GET_VAR 'xs: kotlin.Array<<root>.A1> declared in <root>.AA.<init>' type=kotlin.Array<<root>.A1> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
GET_VAR 'xs: kotlin.Array<<root>.A1> [vararg] declared in <root>.AA.<init>' type=kotlin.Array<<root>.A1> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xs> visibility:public modality:FINAL <> ($this:<root>.AA) returnType:kotlin.Array<out <root>.A1>
correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.AA
@@ -13,7 +13,7 @@ FILE fqName:<root> fileName:/fun.kt
CONST String type=kotlin.String value=""
BLOCK_BODY
FUN name:test3 visibility:public modality:FINAL <> (args:kotlin.Array<kotlin.String>) returnType:kotlin.Unit
VALUE_PARAMETER name:args index:0 type:kotlin.Array<kotlin.String>
VALUE_PARAMETER name:args index:0 type:kotlin.Array<kotlin.String> varargElementType:kotlin.String [vararg]
BLOCK_BODY
FUN name:textExt1 visibility:public modality:FINAL <> ($receiver:kotlin.String, i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
@@ -16,7 +16,7 @@ FILE fqName:<root> fileName:/localFun.kt
CONST String type=kotlin.String value=""
BLOCK_BODY
FUN name:test3 visibility:local modality:FINAL <> (args:kotlin.Array<kotlin.String>) returnType:kotlin.Unit
VALUE_PARAMETER name:args index:0 type:kotlin.Array<kotlin.String>
VALUE_PARAMETER name:args index:0 type:kotlin.Array<kotlin.String> varargElementType:kotlin.String [vararg]
BLOCK_BODY
FUN name:textExt1 visibility:local modality:FINAL <> ($receiver:kotlin.String, i:kotlin.Int, j:TT of <root>.outer) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
@@ -2,10 +2,11 @@ FILE fqName:<root> fileName:/arrayAssignment.kt
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:x type:kotlin.IntArray [val]
ERROR_CALL 'Cannot bind 3 arguments to intArrayOf call with 1 parameters' type=kotlin.IntArray
CONST Int type=kotlin.Int value=1
CONST Int type=kotlin.Int value=2
CONST Int type=kotlin.Int value=3
CALL 'public final fun intArrayOf (vararg elements: kotlin.Int): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null
elements: VARARG type=kotlin.IntArray varargElementType=kotlin.Int
CONST Int type=kotlin.Int value=1
CONST Int type=kotlin.Int value=2
CONST Int type=kotlin.Int value=3
CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=null
$this: GET_VAR 'val x: kotlin.IntArray [val] declared in <root>.test' type=kotlin.IntArray origin=null
index: CONST Int type=kotlin.Int value=1
@@ -17,9 +18,10 @@ FILE fqName:<root> fileName:/arrayAssignment.kt
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=null
$this: ERROR_CALL 'Cannot bind 3 arguments to intArrayOf call with 1 parameters' type=kotlin.IntArray
CONST Int type=kotlin.Int value=1
CONST Int type=kotlin.Int value=2
CONST Int type=kotlin.Int value=3
$this: CALL 'public final fun intArrayOf (vararg elements: kotlin.Int): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null
elements: VARARG type=kotlin.IntArray varargElementType=kotlin.Int
CONST Int type=kotlin.Int value=1
CONST Int type=kotlin.Int value=2
CONST Int type=kotlin.Int value=3
index: CALL 'public final fun foo (): kotlin.Int declared in <root>' type=kotlin.Int origin=null
value: CONST Int type=kotlin.Int value=1
@@ -2,10 +2,11 @@ FILE fqName:<root> fileName:/arrayAugmentedAssignment1.kt
FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.IntArray
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.IntArray declared in <root>'
ERROR_CALL 'Cannot bind 3 arguments to intArrayOf call with 1 parameters' type=kotlin.IntArray
CONST Int type=kotlin.Int value=1
CONST Int type=kotlin.Int value=2
CONST Int type=kotlin.Int value=3
CALL 'public final fun intArrayOf (vararg elements: kotlin.Int): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null
elements: VARARG type=kotlin.IntArray varargElementType=kotlin.Int
CONST Int type=kotlin.Int value=1
CONST Int type=kotlin.Int value=2
CONST Int type=kotlin.Int value=3
FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Int declared in <root>'
@@ -98,9 +98,9 @@ FILE fqName:<root> fileName:/caoWithAdaptationForSam.kt
VALUE_PARAMETER name:newValue index:1 type:kotlin.Int
BLOCK_BODY
FUN name:withVararg visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Int
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun withVararg (xs: kotlin.IntArray): kotlin.Int declared in <root>'
RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in <root>'
CONST Int type=kotlin.Int value=42
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
@@ -9,7 +9,7 @@ FILE fqName:<root> fileName:/constructorWithAdaptedArguments.kt
CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C
CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:<root>.C [primary]
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]'
@@ -35,7 +35,7 @@ FILE fqName:<root> fileName:/constructorWithAdaptedArguments.kt
CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Outer.Inner
CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:<root>.Outer.Inner [primary]
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]'
@@ -69,15 +69,15 @@ FILE fqName:<root> fileName:/constructorWithAdaptedArguments.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testConstructor (): IrErrorType declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use]>#' type=IrErrorType
FUNCTION_REFERENCE 'public constructor <init> (xs: kotlin.IntArray) [primary] declared in <root>.C' type=kotlin.reflect.KFunction1<kotlin.IntArray, <root>.C> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public constructor <init> (vararg xs: kotlin.Int) [primary] declared in <root>.C' type=kotlin.reflect.KFunction1<kotlin.IntArray, <root>.C> origin=null reflectionTarget=<same>
FUN name:testInnerClassConstructor visibility:public modality:FINAL <> (outer:<root>.Outer) returnType:IrErrorType
VALUE_PARAMETER name:outer index:0 type:<root>.Outer
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testInnerClassConstructor (outer: <root>.Outer): IrErrorType declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use]>#' type=IrErrorType
FUNCTION_REFERENCE 'public constructor <init> (xs: kotlin.IntArray) [primary] declared in <root>.Outer.Inner' type=kotlin.reflect.KFunction1<kotlin.IntArray, <root>.Outer.Inner> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public constructor <init> (vararg xs: kotlin.Int) [primary] declared in <root>.Outer.Inner' type=kotlin.reflect.KFunction1<kotlin.IntArray, <root>.Outer.Inner> origin=null reflectionTarget=<same>
FUN name:testInnerClassConstructorCapturingOuter visibility:public modality:FINAL <> () returnType:IrErrorType
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testInnerClassConstructorCapturingOuter (): IrErrorType declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use]>#' type=IrErrorType
FUNCTION_REFERENCE 'public constructor <init> (xs: kotlin.IntArray) [primary] declared in <root>.Outer.Inner' type=kotlin.reflect.KFunction1<kotlin.IntArray, <root>.Outer.Inner> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public constructor <init> (vararg xs: kotlin.Int) [primary] declared in <root>.Outer.Inner' type=kotlin.reflect.KFunction1<kotlin.IntArray, <root>.Outer.Inner> origin=null reflectionTarget=<same>
@@ -13,9 +13,9 @@ FILE fqName:<root> fileName:/unboundMemberReferenceWithAdaptedArguments.kt
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]'
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.A, xs:kotlin.IntArray) returnType:kotlin.Int
$this: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun foo (xs: kotlin.IntArray): kotlin.Int declared in <root>.A'
RETURN type=kotlin.Nothing from='public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in <root>.A'
CONST Int type=kotlin.Int value=1
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
@@ -38,9 +38,9 @@ FILE fqName:<root> fileName:/unboundMemberReferenceWithAdaptedArguments.kt
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Obj modality:FINAL visibility:public superTypes:[<root>.A]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Obj, xs:kotlin.IntArray) returnType:kotlin.Int
$this: VALUE_PARAMETER name:<this> type:<root>.Obj
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (xs: kotlin.IntArray): kotlin.Int declared in <root>.Obj'
RETURN type=kotlin.Nothing from='public final fun foo (vararg xs: kotlin.Int): kotlin.Int declared in <root>.Obj'
CONST Int type=kotlin.Int value=1
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
@@ -58,13 +58,13 @@ FILE fqName:<root> fileName:/unboundMemberReferenceWithAdaptedArguments.kt
FUN name:testUnbound visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use1]>#' type=IrErrorType
FUNCTION_REFERENCE 'public open fun foo (xs: kotlin.IntArray): kotlin.Int declared in <root>.A' type=kotlin.reflect.KFunction2<<root>.A, kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in <root>.A' type=kotlin.reflect.KFunction2<<root>.A, kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
FUN name:testBound visibility:public modality:FINAL <> (a:<root>.A) returnType:kotlin.Unit
VALUE_PARAMETER name:a index:0 type:<root>.A
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use2]>#' type=IrErrorType
FUNCTION_REFERENCE 'public open fun foo (xs: kotlin.IntArray): kotlin.Int declared in <root>.A' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in <root>.A' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
FUN name:testObject visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use2]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun foo (xs: kotlin.IntArray): kotlin.Int declared in <root>.Obj' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun foo (vararg xs: kotlin.Int): kotlin.Int declared in <root>.Obj' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
@@ -21,11 +21,11 @@ FILE fqName:<root> fileName:/withAdaptationForSam.kt
VALUE_PARAMETER name:foo index:0 type:<root>.IFoo
BLOCK_BODY
FUN name:withVararg visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Int
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun withVararg (xs: kotlin.IntArray): kotlin.Int declared in <root>'
RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in <root>'
CONST Int type=kotlin.Int value=42
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/useFoo]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun withVararg (xs: kotlin.IntArray): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
@@ -18,9 +18,9 @@ FILE fqName:<root> fileName:/withAdaptedArguments.kt
RETURN type=kotlin.Nothing from='public final fun fnWithDefault (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in <root>'
CONST String type=kotlin.String value="abc"
FUN name:fnWithVarargs visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.String
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun fnWithVarargs (xs: kotlin.IntArray): kotlin.String declared in <root>'
RETURN type=kotlin.Nothing from='public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in <root>'
CONST String type=kotlin.String value="abc"
CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Host
@@ -30,9 +30,9 @@ FILE fqName:<root> fileName:/withAdaptedArguments.kt
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]'
FUN name:importedObjectMemberWithVarargs visibility:public modality:FINAL <> ($this:<root>.Host, xs:kotlin.IntArray) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.Host
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun importedObjectMemberWithVarargs (xs: kotlin.IntArray): kotlin.String declared in <root>.Host'
RETURN type=kotlin.Nothing from='public final fun importedObjectMemberWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host'
CONST String type=kotlin.String value="abc"
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
@@ -56,7 +56,7 @@ FILE fqName:<root> fileName:/withAdaptedArguments.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testVararg (): IrErrorType declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun fnWithVarargs (xs: kotlin.IntArray): kotlin.String declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUN name:testCoercionToUnit visibility:public modality:FINAL <> () returnType:IrErrorType
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testCoercionToUnit (): IrErrorType declared in <root>'
@@ -66,4 +66,4 @@ FILE fqName:<root> fileName:/withAdaptedArguments.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testImportedObjectMember (): IrErrorType declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun importedObjectMemberWithVarargs (xs: kotlin.IntArray): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun importedObjectMemberWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
@@ -13,40 +13,40 @@ FILE fqName:<root> fileName:/withArgumentAdaptationAndReceiver.kt
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]'
FUN name:withVararg visibility:public modality:FINAL <> ($this:<root>.Host, xs:kotlin.IntArray) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.Host
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun withVararg (xs: kotlin.IntArray): kotlin.String declared in <root>.Host'
RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host'
CONST String type=kotlin.String value=""
FUN name:testImplicitThis visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Host
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun withVararg (xs: kotlin.IntArray): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUN name:testBoundReceiverLocalVal visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Host
BLOCK_BODY
VAR name:h type:<root>.Host [val]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Host' type=<root>.Host origin=null
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun withVararg (xs: kotlin.IntArray): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUN name:testBoundReceiverLocalVar visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Host
BLOCK_BODY
VAR name:h type:<root>.Host [var]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Host' type=<root>.Host origin=null
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun withVararg (xs: kotlin.IntArray): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUN name:testBoundReceiverParameter visibility:public modality:FINAL <> ($this:<root>.Host, h:<root>.Host) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Host
VALUE_PARAMETER name:h index:0 type:<root>.Host
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun withVararg (xs: kotlin.IntArray): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUN name:testBoundReceiverExpression visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Host
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun withVararg (xs: kotlin.IntArray): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -1,11 +1,11 @@
FILE fqName:<root> fileName:/withVarargViewedAsArray.kt
FUN name:sum visibility:public modality:FINAL <> (args:kotlin.IntArray) returnType:kotlin.Int
VALUE_PARAMETER name:args index:0 type:kotlin.IntArray
VALUE_PARAMETER name:args index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
VAR name:result type:kotlin.Int [var]
CONST Int type=kotlin.Int value=0
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.IntArray [val]
GET_VAR 'args: kotlin.IntArray declared in <root>.sum' type=kotlin.IntArray origin=null
GET_VAR 'args: kotlin.IntArray [vararg] declared in <root>.sum' type=kotlin.IntArray origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.IntIterator [val]
CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null
$this: GET_VAR 'val tmp_0: kotlin.IntArray [val] declared in <root>.sum' type=kotlin.IntArray origin=null
@@ -20,26 +20,28 @@ FILE fqName:<root> fileName:/withVarargViewedAsArray.kt
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'var result: kotlin.Int [var] declared in <root>.sum' type=kotlin.Int origin=null
other: GET_VAR 'val arg: kotlin.Int [val] declared in <root>.sum' type=kotlin.Int origin=null
RETURN type=kotlin.Nothing from='public final fun sum (args: kotlin.IntArray): kotlin.Int declared in <root>'
RETURN type=kotlin.Nothing from='public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in <root>'
GET_VAR 'var result: kotlin.Int [var] declared in <root>.sum' type=kotlin.Int origin=null
FUN name:nsum visibility:public modality:FINAL <> (args:kotlin.Array<kotlin.Number>) returnType:kotlin.Int
VALUE_PARAMETER name:args index:0 type:kotlin.Array<kotlin.Number>
VALUE_PARAMETER name:args index:0 type:kotlin.Array<kotlin.Number> varargElementType:kotlin.Number [vararg]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun nsum (args: kotlin.Array<kotlin.Number>): kotlin.Int declared in <root>'
CALL 'public final fun sum (args: kotlin.IntArray): kotlin.Int declared in <root>' type=kotlin.Int origin=null
args: CONSTRUCTOR_CALL 'public constructor <init> (size: kotlin.Int, init: kotlin.Function1<kotlin.Int, kotlin.Int>) declared in kotlin.IntArray' type=kotlin.IntArray origin=null
size: CALL 'public final fun <get-size> (): kotlin.Int declared in kotlin.Array' type=kotlin.Int origin=null
$this: GET_VAR 'args: kotlin.Array<kotlin.Number> declared in <root>.nsum' type=kotlin.Array<kotlin.Number> origin=null
init: FUN_EXPR type=kotlin.Function1<kotlin.Int, kotlin.Int> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Int
VALUE_PARAMETER name:it index:0 type:kotlin.Int
BLOCK_BODY
CALL 'public abstract fun toInt (): kotlin.Int declared in kotlin.Number' type=kotlin.Int origin=null
$this: CALL 'public final fun get (index: kotlin.Int): kotlin.Number [operator] declared in kotlin.Array' type=kotlin.Number origin=null
$this: GET_VAR 'args: kotlin.Array<kotlin.Number> declared in <root>.nsum' type=kotlin.Array<kotlin.Number> origin=null
index: GET_VAR 'it: kotlin.Int declared in <root>.nsum.<anonymous>' type=kotlin.Int origin=null
RETURN type=kotlin.Nothing from='public final fun nsum (vararg args: kotlin.Number): kotlin.Int declared in <root>'
CALL 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.Int origin=null
args: VARARG type=kotlin.IntArray varargElementType=kotlin.Int
SPREAD_ELEMENT
CONSTRUCTOR_CALL 'public constructor <init> (size: kotlin.Int, init: kotlin.Function1<kotlin.Int, kotlin.Int>) declared in kotlin.IntArray' type=kotlin.IntArray origin=null
size: CALL 'public final fun <get-size> (): kotlin.Int declared in kotlin.Array' type=kotlin.Int origin=null
$this: GET_VAR 'args: kotlin.Array<kotlin.Number> [vararg] declared in <root>.nsum' type=kotlin.Array<kotlin.Number> origin=null
init: FUN_EXPR type=kotlin.Function1<kotlin.Int, kotlin.Int> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Int
VALUE_PARAMETER name:it index:0 type:kotlin.Int
BLOCK_BODY
CALL 'public abstract fun toInt (): kotlin.Int declared in kotlin.Number' type=kotlin.Int origin=null
$this: CALL 'public final fun get (index: kotlin.Int): kotlin.Number [operator] declared in kotlin.Array' type=kotlin.Number origin=null
$this: GET_VAR 'args: kotlin.Array<kotlin.Number> [vararg] declared in <root>.nsum' type=kotlin.Array<kotlin.Number> origin=null
index: GET_VAR 'it: kotlin.Int declared in <root>.nsum.<anonymous>' type=kotlin.Int origin=null
FUN name:zap visibility:public modality:FINAL <> (b:kotlin.Array<kotlin.String>, k:kotlin.Int) returnType:kotlin.Unit
VALUE_PARAMETER name:b index:0 type:kotlin.Array<kotlin.String>
VALUE_PARAMETER name:b index:0 type:kotlin.Array<kotlin.String> varargElementType:kotlin.String [vararg]
VALUE_PARAMETER name:k index:1 type:kotlin.Int
EXPRESSION_BODY
CONST Int type=kotlin.Int value=42
@@ -59,16 +61,16 @@ FILE fqName:<root> fileName:/withVarargViewedAsArray.kt
FUN name:testPlainArgs visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/usePlainArgs]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun sum (args: kotlin.IntArray): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
FUN name:testPrimitiveArrayAsVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun usePrimitiveArray (fn: kotlin.Function1<kotlin.IntArray, kotlin.Int>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUNCTION_REFERENCE 'public final fun sum (args: kotlin.IntArray): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
fn: FUNCTION_REFERENCE 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
FUN name:testArrayAsVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/useArray]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun nsum (args: kotlin.Array<kotlin.Number>): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.Array<kotlin.Number>, kotlin.Int> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun nsum (vararg args: kotlin.Number): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.Array<kotlin.Number>, kotlin.Int> origin=null reflectionTarget=<same>
FUN name:testArrayAndDefaults visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/useStringArray]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun zap (b: kotlin.Array<kotlin.String>, k: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.reflect.KFunction2<kotlin.Array<kotlin.String>, kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun zap (vararg b: kotlin.String, k: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.reflect.KFunction2<kotlin.Array<kotlin.String>, kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>
@@ -18,19 +18,20 @@ FILE fqName:<root> fileName:/samConversionInVarargs.kt
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:useVararg visibility:public modality:FINAL <> (foos:kotlin.Array<<root>.IFoo>) returnType:kotlin.Unit
VALUE_PARAMETER name:foos index:0 type:kotlin.Array<<root>.IFoo>
VALUE_PARAMETER name:foos index:0 type:kotlin.Array<<root>.IFoo> varargElementType:<root>.IFoo [vararg]
BLOCK_BODY
FUN name:testLambda visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun useVararg (foos: kotlin.Array<<root>.IFoo>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
foos: FUN_EXPR type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=LAMBDA
ERROR_CALL 'Cannot bind 2 arguments to useVararg call with 1 parameters' type=kotlin.Unit
FUN_EXPR type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Unit
VALUE_PARAMETER name:it index:0 type:kotlin.Int
BLOCK_BODY
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
VARARG type=kotlin.Array<<root>.IFoo> varargElementType=<root>.IFoo
FUN name:testSeveralLambdas visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Cannot bind 3 arguments to useVararg call with 1 parameters' type=kotlin.Unit
ERROR_CALL 'Cannot bind 4 arguments to useVararg call with 1 parameters' type=kotlin.Unit
FUN_EXPR type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Unit
VALUE_PARAMETER name:it index:0 type:kotlin.Int
@@ -46,12 +47,13 @@ FILE fqName:<root> fileName:/samConversionInVarargs.kt
VALUE_PARAMETER name:it index:0 type:kotlin.Int
BLOCK_BODY
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
VARARG type=kotlin.Array<<root>.IFoo> varargElementType=<root>.IFoo
FUN name:withVarargOfInt visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.String
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun withVarargOfInt (xs: kotlin.IntArray): kotlin.String declared in <root>'
RETURN type=kotlin.Nothing from='public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in <root>'
CONST String type=kotlin.String value=""
FUN name:testAdaptedCR visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/useVararg]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun withVarargOfInt (xs: kotlin.IntArray): kotlin.String declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
@@ -19,9 +19,9 @@ FILE fqName:<root> fileName:/samConversionOnCallableReference.kt
FUN name:foo0 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
FUN name:foo1 visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Int
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo1 (xs: kotlin.IntArray): kotlin.Int declared in <root>'
RETURN type=kotlin.Nothing from='public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in <root>'
CONST Int type=kotlin.Int value=1
FUN name:use visibility:public modality:FINAL <> (r:<root>.KRunnable) returnType:kotlin.Unit
VALUE_PARAMETER name:r index:0 type:<root>.KRunnable
@@ -35,7 +35,7 @@ FILE fqName:<root> fileName:/samConversionOnCallableReference.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testSamCosntructorOnAdapted (): IrErrorType declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/KRunnable]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun foo1 (xs: kotlin.IntArray): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
FUN name:testSamConversion visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun use (r: <root>.KRunnable): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
@@ -43,4 +43,4 @@ FILE fqName:<root> fileName:/samConversionOnCallableReference.kt
FUN name:testSamConversionOnAdapted visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use]>#' type=IrErrorType
FUNCTION_REFERENCE 'public final fun foo1 (xs: kotlin.IntArray): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
FUNCTION_REFERENCE 'public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.Int> origin=null reflectionTarget=<same>
@@ -17,10 +17,11 @@ FILE fqName:<root> fileName:/incrementDecrement.kt
PROPERTY name:arr visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:arr type:kotlin.IntArray visibility:private [final,static]
EXPRESSION_BODY
ERROR_CALL 'Cannot bind 3 arguments to intArrayOf call with 1 parameters' type=kotlin.IntArray
CONST Int type=kotlin.Int value=1
CONST Int type=kotlin.Int value=2
CONST Int type=kotlin.Int value=3
CALL 'public final fun intArrayOf (vararg elements: kotlin.Int): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null
elements: VARARG type=kotlin.IntArray varargElementType=kotlin.Int
CONST Int type=kotlin.Int value=1
CONST Int type=kotlin.Int value=2
CONST Int type=kotlin.Int value=3
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-arr> visibility:public modality:FINAL <> () returnType:kotlin.IntArray
correspondingProperty: PROPERTY name:arr visibility:public modality:FINAL [val]
BLOCK_BODY
+7 -5
View File
@@ -20,9 +20,9 @@ FILE fqName:<root> fileName:/kt28456.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:get visibility:public modality:FINAL <> ($receiver:<root>.A, xs:kotlin.IntArray) returnType:kotlin.Int [operator]
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun get (xs: kotlin.IntArray): kotlin.Int [operator] declared in <root>'
RETURN type=kotlin.Nothing from='public final fun get (vararg xs: kotlin.Int): kotlin.Int [operator] declared in <root>'
CONST Int type=kotlin.Int value=0
FUN name:set visibility:public modality:FINAL <> ($receiver:<root>.A, i:kotlin.Int, j:kotlin.Int, v:kotlin.Int) returnType:kotlin.Unit [operator]
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
@@ -44,9 +44,11 @@ FILE fqName:<root> fileName:/kt28456.kt
RETURN type=kotlin.Nothing from='public final fun testPostfixIncrement (a: <root>.A): kotlin.Int declared in <root>'
BLOCK type=kotlin.Int origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val]
ERROR_CALL 'Cannot bind 2 arguments to get call with 1 parameters' type=kotlin.Int
CONST Int type=kotlin.Int value=1
CONST Int type=kotlin.Int value=2
CALL 'public final fun get (vararg xs: kotlin.Int): kotlin.Int [operator] declared in <root>' type=kotlin.Int origin=null
$receiver: GET_VAR 'a: <root>.A declared in <root>.testPostfixIncrement' type=<root>.A origin=null
xs: VARARG type=kotlin.IntArray varargElementType=kotlin.Int
CONST Int type=kotlin.Int value=1
CONST Int type=kotlin.Int value=2
CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit [operator] declared in <root>' type=kotlin.Unit origin=null
$receiver: GET_VAR 'a: <root>.A declared in <root>.testPostfixIncrement' type=<root>.A origin=null
i: CONST Int type=kotlin.Int value=1
+1 -1
View File
@@ -20,7 +20,7 @@ FILE fqName:<root> fileName:/kt28456a.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:set visibility:public modality:FINAL <> ($receiver:<root>.A, i:kotlin.IntArray, v:kotlin.Int) returnType:kotlin.Unit [operator]
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:i index:0 type:kotlin.IntArray
VALUE_PARAMETER name:i index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
VALUE_PARAMETER name:v index:1 type:kotlin.Int
BLOCK_BODY
FUN name:testSimpleAssignment visibility:public modality:FINAL <> (a:<root>.A) returnType:kotlin.Unit
@@ -78,7 +78,7 @@ FILE fqName:<root> fileName:/signedToUnsignedConversions_test.kt
VALUE_PARAMETER name:u index:0 type:kotlin.ULong
BLOCK_BODY
FUN name:takeUBytes visibility:public modality:FINAL <> (u:kotlin.Array<kotlin.UByte>) returnType:kotlin.Unit
VALUE_PARAMETER name:u index:0 type:kotlin.Array<kotlin.UByte>
VALUE_PARAMETER name:u index:0 type:kotlin.Array<kotlin.UByte> varargElementType:kotlin.UByte [vararg]
BLOCK_BODY
FUN name:takeLong visibility:public modality:FINAL <> (l:kotlin.Long) returnType:kotlin.Unit
VALUE_PARAMETER name:l index:0 type:kotlin.Long
+7 -5
View File
@@ -2,7 +2,7 @@ FILE fqName:<root> fileName:/vararg.kt
PROPERTY name:test1 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Array<kotlin.String> visibility:private [final,static]
EXPRESSION_BODY
CALL 'public final fun arrayOf <T> (elements: kotlin.Array<out T of kotlin.arrayOf>): kotlin.Array<T of kotlin.arrayOf> [inline] declared in kotlin' type=kotlin.Array<kotlin.String> origin=null
CALL 'public final fun arrayOf <T> (vararg elements: T of kotlin.arrayOf): kotlin.Array<T of kotlin.arrayOf> [inline] declared in kotlin' type=kotlin.Array<kotlin.String> origin=null
<T>: kotlin.String
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> () returnType:kotlin.Array<kotlin.String>
correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val]
@@ -12,10 +12,12 @@ FILE fqName:<root> fileName:/vararg.kt
PROPERTY name:test2 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Array<kotlin.String> visibility:private [final,static]
EXPRESSION_BODY
ERROR_CALL 'Cannot bind 3 arguments to arrayOf call with 1 parameters' type=kotlin.Array<kotlin.String>
CONST String type=kotlin.String value="1"
CONST String type=kotlin.String value="2"
CONST String type=kotlin.String value="3"
CALL 'public final fun arrayOf <T> (vararg elements: T of kotlin.arrayOf): kotlin.Array<T of kotlin.arrayOf> [inline] declared in kotlin' type=kotlin.Array<kotlin.String> origin=null
<T>: kotlin.String
elements: VARARG type=kotlin.Array<out kotlin.String> varargElementType=kotlin.String
CONST String type=kotlin.String value="1"
CONST String type=kotlin.String value="2"
CONST String type=kotlin.String value="3"
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test2> visibility:public modality:FINAL <> () returnType:kotlin.Array<kotlin.String>
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val]
BLOCK_BODY
@@ -1,27 +0,0 @@
FILE fqName:<root> fileName:/varargWithImplicitCast.kt
FUN name:testScalar visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.IntArray
VALUE_PARAMETER name:a index:0 type:kotlin.Any
BLOCK_BODY
WHEN type=kotlin.Unit origin=IF
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Int
GET_VAR 'a: kotlin.Any declared in <root>.testScalar' type=kotlin.Any origin=null
then: RETURN type=kotlin.Nothing from='public final fun testScalar (a: kotlin.Any): kotlin.IntArray declared in <root>'
CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null
RETURN type=kotlin.Nothing from='public final fun testScalar (a: kotlin.Any): kotlin.IntArray declared in <root>'
CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null
elements: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int
GET_VAR 'a: kotlin.Any declared in <root>.testScalar' type=kotlin.Any origin=null
FUN name:testSpread visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.IntArray
VALUE_PARAMETER name:a index:0 type:kotlin.Any
BLOCK_BODY
WHEN type=kotlin.Unit origin=IF
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.IntArray
GET_VAR 'a: kotlin.Any declared in <root>.testSpread' type=kotlin.Any origin=null
then: RETURN type=kotlin.Nothing from='public final fun testSpread (a: kotlin.Any): kotlin.IntArray declared in <root>'
CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null
RETURN type=kotlin.Nothing from='public final fun testSpread (a: kotlin.Any): kotlin.IntArray declared in <root>'
CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null
elements: TYPE_OP type=kotlin.IntArray origin=IMPLICIT_CAST typeOperand=kotlin.IntArray
GET_VAR 'a: kotlin.Any declared in <root>.testSpread' type=kotlin.Any origin=null
@@ -1,3 +1,5 @@
// FIR_IDENTICAL
fun testScalar(a: Any): IntArray {
if (a !is Int) return intArrayOf()
return intArrayOf(a)
@@ -52,15 +52,17 @@ FILE fqName:<root> fileName:/intersectionType1_NI.kt
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:a1 type:kotlin.Array<<root>.In<kotlin.Int>> [val]
CALL 'public final fun arrayOf <T> (elements: kotlin.Array<out T of kotlin.arrayOf>): kotlin.Array<T of kotlin.arrayOf> [inline] declared in kotlin' type=kotlin.Array<<root>.In<kotlin.Int>> origin=null
CALL 'public final fun arrayOf <T> (vararg elements: T of kotlin.arrayOf): kotlin.Array<T of kotlin.arrayOf> [inline] declared in kotlin' type=kotlin.Array<<root>.In<kotlin.Int>> origin=null
<T>: <root>.In<kotlin.Int>
elements: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.In' type=<root>.In<kotlin.Int> origin=null
<class: I>: kotlin.Int
elements: VARARG type=kotlin.Array<out <root>.In<kotlin.Int>> varargElementType=<root>.In<kotlin.Int>
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.In' type=<root>.In<kotlin.Int> origin=null
<class: I>: kotlin.Int
VAR name:a2 type:kotlin.Array<<root>.In<kotlin.String>> [val]
CALL 'public final fun arrayOf <T> (elements: kotlin.Array<out T of kotlin.arrayOf>): kotlin.Array<T of kotlin.arrayOf> [inline] declared in kotlin' type=kotlin.Array<<root>.In<kotlin.String>> origin=null
CALL 'public final fun arrayOf <T> (vararg elements: T of kotlin.arrayOf): kotlin.Array<T of kotlin.arrayOf> [inline] declared in kotlin' type=kotlin.Array<<root>.In<kotlin.String>> origin=null
<T>: <root>.In<kotlin.String>
elements: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.In' type=<root>.In<kotlin.String> origin=null
<class: I>: kotlin.String
elements: VARARG type=kotlin.Array<out <root>.In<kotlin.String>> varargElementType=<root>.In<kotlin.String>
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.In' type=<root>.In<kotlin.String> origin=null
<class: I>: kotlin.String
CALL 'public final fun foo <T> (a: kotlin.Array<<root>.In<T of <root>.foo>>, b: kotlin.Array<<root>.In<kotlin.String>>): kotlin.Boolean declared in <root>' type=kotlin.Boolean origin=null
<T>: kotlin.Int
a: GET_VAR 'val a1: kotlin.Array<<root>.In<kotlin.Int>> [val] declared in <root>.test' type=kotlin.Array<<root>.In<kotlin.Int>> origin=null
@@ -52,15 +52,17 @@ FILE fqName:<root> fileName:/intersectionType1_OI.kt
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:a1 type:kotlin.Array<<root>.In<kotlin.Int>> [val]
CALL 'public final fun arrayOf <T> (elements: kotlin.Array<out T of kotlin.arrayOf>): kotlin.Array<T of kotlin.arrayOf> [inline] declared in kotlin' type=kotlin.Array<<root>.In<kotlin.Int>> origin=null
CALL 'public final fun arrayOf <T> (vararg elements: T of kotlin.arrayOf): kotlin.Array<T of kotlin.arrayOf> [inline] declared in kotlin' type=kotlin.Array<<root>.In<kotlin.Int>> origin=null
<T>: <root>.In<kotlin.Int>
elements: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.In' type=<root>.In<kotlin.Int> origin=null
<class: I>: kotlin.Int
elements: VARARG type=kotlin.Array<out <root>.In<kotlin.Int>> varargElementType=<root>.In<kotlin.Int>
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.In' type=<root>.In<kotlin.Int> origin=null
<class: I>: kotlin.Int
VAR name:a2 type:kotlin.Array<<root>.In<kotlin.String>> [val]
CALL 'public final fun arrayOf <T> (elements: kotlin.Array<out T of kotlin.arrayOf>): kotlin.Array<T of kotlin.arrayOf> [inline] declared in kotlin' type=kotlin.Array<<root>.In<kotlin.String>> origin=null
CALL 'public final fun arrayOf <T> (vararg elements: T of kotlin.arrayOf): kotlin.Array<T of kotlin.arrayOf> [inline] declared in kotlin' type=kotlin.Array<<root>.In<kotlin.String>> origin=null
<T>: <root>.In<kotlin.String>
elements: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.In' type=<root>.In<kotlin.String> origin=null
<class: I>: kotlin.String
elements: VARARG type=kotlin.Array<out <root>.In<kotlin.String>> varargElementType=<root>.In<kotlin.String>
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.In' type=<root>.In<kotlin.String> origin=null
<class: I>: kotlin.String
CALL 'public final fun foo <T> (a: kotlin.Array<<root>.In<T of <root>.foo>>, b: kotlin.Array<<root>.In<kotlin.String>>): kotlin.Boolean declared in <root>' type=kotlin.Boolean origin=null
<T>: kotlin.Int
a: GET_VAR 'val a1: kotlin.Array<<root>.In<kotlin.Int>> [val] declared in <root>.test' type=kotlin.Array<<root>.In<kotlin.Int>> origin=null
@@ -7,7 +7,7 @@ FILE: jvm.kt
public final fun test(): R|kotlin/Unit| {
lval res1: R|kotlin/Boolean| = this@R|/A|.R|/Some.foo|(Int(1))
lval res2: R|kotlin/Boolean| = this@R|/A|.R|/Some.foo|(Int(1).R|kotlin/Int.unaryMinus|())
lval res3: R|ft<kotlin/Array<ft<kotlin/String, kotlin/String?>!>, kotlin/Array<out ft<kotlin/String, kotlin/String?>!>?>!| = this@R|/A|.R|/Some.bar|(R|kotlin/intArrayOf|(Int(0), Int(2), Int(2).R|kotlin/Int.unaryMinus|()))
lval res3: R|ft<kotlin/Array<ft<kotlin/String, kotlin/String?>!>, kotlin/Array<out ft<kotlin/String, kotlin/String?>!>?>!| = this@R|/A|.R|/Some.bar|(R|kotlin/intArrayOf|(vararg(Int(0), Int(2)), Int(2).R|kotlin/Int.unaryMinus|()))
}
}
@@ -1,3 +1,3 @@
FILE: Some.kt
public final val someList: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(1), Int(2), Int(3))
public final val someList: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(vararg(Int(1), Int(2), Int(3)))
public get(): R|kotlin/collections/List<kotlin/Int>|