Generate annotations for declarations in psi2ir

This commit is contained in:
Dmitry Petrov
2018-04-03 17:47:03 +03:00
parent c2dced775d
commit 57077a5eb8
35 changed files with 1522 additions and 45 deletions
@@ -21,8 +21,10 @@ import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
import org.jetbrains.kotlin.ir.util.patchDeclarationParents
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi2ir.transformations.AnnotationGenerator
import org.jetbrains.kotlin.psi2ir.generators.GeneratorContext
import org.jetbrains.kotlin.psi2ir.generators.ModuleGenerator
import org.jetbrains.kotlin.psi2ir.transformations.generateAnnotationsForDeclarations
import org.jetbrains.kotlin.psi2ir.transformations.insertImplicitCasts
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.utils.SmartList
@@ -56,6 +58,7 @@ class Psi2IrTranslator(val configuration: Psi2IrConfiguration = Psi2IrConfigurat
private fun postprocess(context: GeneratorContext, irElement: IrElement) {
insertImplicitCasts(context.builtIns, irElement, context.symbolTable)
generateAnnotationsForDeclarations(context, irElement)
postprocessingSteps.forEach { it.postprocess(context, irElement) }
@@ -0,0 +1,80 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. 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.psi2ir.generators
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrGetEnumValueImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrVarargImpl
import org.jetbrains.kotlin.psi2ir.transformations.AnnotationGenerator
import org.jetbrains.kotlin.resolve.constants.*
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.typeUtil.builtIns
class ConstantValueGenerator(
private val context: GeneratorContext,
private val annotationGenerator: AnnotationGenerator? = null
) {
fun generateConstantValueAsExpression(
startOffset: Int,
endOffset: Int,
constantValue: ConstantValue<*>,
varargElementType: KotlinType? = null
): IrExpression {
val constantType = constantValue.getType(context.moduleDescriptor)
return when (constantValue) {
is StringValue -> IrConstImpl.string(startOffset, endOffset, constantType, constantValue.value)
is IntValue -> IrConstImpl.int(startOffset, endOffset, constantType, constantValue.value)
is NullValue -> IrConstImpl.constNull(startOffset, endOffset, constantType)
is BooleanValue -> IrConstImpl.boolean(startOffset, endOffset, constantType, constantValue.value)
is LongValue -> IrConstImpl.long(startOffset, endOffset, constantType, constantValue.value)
is DoubleValue -> IrConstImpl.double(startOffset, endOffset, constantType, constantValue.value)
is FloatValue -> IrConstImpl.float(startOffset, endOffset, constantType, constantValue.value)
is CharValue -> IrConstImpl.char(startOffset, endOffset, constantType, constantValue.value)
is ByteValue -> IrConstImpl.byte(startOffset, endOffset, constantType, constantValue.value)
is ShortValue -> IrConstImpl.short(startOffset, endOffset, constantType, constantValue.value)
is ArrayValue -> {
val arrayElementType = varargElementType ?: constantType.getArrayElementType()
IrVarargImpl(
startOffset, endOffset,
constantType,
arrayElementType,
constantValue.value.map {
generateConstantValueAsExpression(startOffset, endOffset, it, null)
}
)
}
is EnumValue -> {
val enumEntryDescriptor =
constantType.memberScope.getContributedClassifier(constantValue.enumEntryName, NoLookupLocation.FROM_BACKEND)
?: throw AssertionError("No such enum entry ${constantValue.enumEntryName} in $constantType")
if (enumEntryDescriptor !is ClassDescriptor) {
throw AssertionError("Enum entry $enumEntryDescriptor should be a ClassDescriptor")
}
IrGetEnumValueImpl(
startOffset, endOffset,
constantType,
context.symbolTable.referenceEnumEntry(enumEntryDescriptor)
)
}
is AnnotationValue -> {
if (annotationGenerator == null) throw AssertionError("Unexpected AnnotationValue: $constantValue")
annotationGenerator.generateAnnotationConstructorCall(constantValue.value)
}
else -> TODO("handle other literal values: ${constantValue::class.simpleName}")
}
}
private fun KotlinType.getArrayElementType() = builtIns.getArrayElementType(this)
}
@@ -34,6 +34,7 @@ import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
import org.jetbrains.kotlin.resolve.DescriptorUtils
class FunctionGenerator(declarationGenerator: DeclarationGenerator) : DeclarationGeneratorExtension(declarationGenerator) {
constructor(context: GeneratorContext) : this(DeclarationGenerator(context))
fun generateFunctionDeclaration(ktFunction: KtNamedFunction): IrFunction =
@@ -39,7 +39,7 @@ import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.BindingContextUtils
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
import org.jetbrains.kotlin.resolve.calls.model.VariableAsFunctionResolvedCall
import org.jetbrains.kotlin.resolve.constants.*
import org.jetbrains.kotlin.resolve.constants.CompileTimeConstant
import org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluator
import org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils
import java.lang.AssertionError
@@ -205,35 +205,12 @@ class StatementGenerator(
?: error("KtConstantExpression was not evaluated: ${expression.text}")
)
fun generateConstantExpression(expression: KtExpression, constant: CompileTimeConstant<*>): IrExpression {
val constantValue = constant.toConstantValue(getInferredTypeWithImplicitCastsOrFail(expression))
val constantType = constantValue.getType(context.moduleDescriptor)
return when (constantValue) {
is StringValue ->
IrConstImpl.string(expression.startOffset, expression.endOffset, constantType, constantValue.value)
is IntValue ->
IrConstImpl.int(expression.startOffset, expression.endOffset, constantType, constantValue.value)
is NullValue ->
IrConstImpl.constNull(expression.startOffset, expression.endOffset, constantType)
is BooleanValue ->
IrConstImpl.boolean(expression.startOffset, expression.endOffset, constantType, constantValue.value)
is LongValue ->
IrConstImpl.long(expression.startOffset, expression.endOffset, constantType, constantValue.value)
is DoubleValue ->
IrConstImpl.double(expression.startOffset, expression.endOffset, constantType, constantValue.value)
is FloatValue ->
IrConstImpl.float(expression.startOffset, expression.endOffset, constantType, constantValue.value)
is CharValue ->
IrConstImpl.char(expression.startOffset, expression.endOffset, constantType, constantValue.value)
is ByteValue ->
IrConstImpl.byte(expression.startOffset, expression.endOffset, constantType, constantValue.value)
is ShortValue ->
IrConstImpl.short(expression.startOffset, expression.endOffset, constantType, constantValue.value)
else ->
TODO("handle other literal types: $constantType")
}
}
fun generateConstantExpression(expression: KtExpression, constant: CompileTimeConstant<*>): IrExpression =
ConstantValueGenerator(context).generateConstantValueAsExpression(
expression.startOffset,
expression.endOffset,
constant.toConstantValue(getInferredTypeWithImplicitCastsOrFail(expression))
)
override fun visitStringTemplateExpression(expression: KtStringTemplateExpression, data: Nothing?): IrStatement {
val entries = expression.entries
@@ -0,0 +1,117 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. 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.psi2ir.transformations
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.PropertyGetterDescriptor
import org.jetbrains.kotlin.descriptors.PropertySetterDescriptor
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
import org.jetbrains.kotlin.ir.declarations.IrField
import org.jetbrains.kotlin.ir.declarations.IrProperty
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid
import org.jetbrains.kotlin.ir.visitors.acceptVoid
import org.jetbrains.kotlin.psi.psiUtil.startOffset
import org.jetbrains.kotlin.psi2ir.generators.ConstantValueGenerator
import org.jetbrains.kotlin.psi2ir.generators.GeneratorContext
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.source.PsiSourceElement
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
fun generateAnnotationsForDeclarations(context: GeneratorContext, irElement: IrElement) {
irElement.acceptVoid(AnnotationGenerator(context))
}
class AnnotationGenerator(private val context: GeneratorContext) : IrElementVisitorVoid {
private val constantValueGenerator = ConstantValueGenerator(context, this)
override fun visitElement(element: IrElement) {
element.acceptChildrenVoid(this)
}
override fun visitDeclaration(declaration: IrDeclaration) {
visitElement(declaration)
generateAnnotationsForDeclaration(declaration)
}
private fun generateAnnotationsForDeclaration(declaration: IrDeclaration) {
val allAnnotations = declaration.descriptor.annotations.getAllAnnotations()
val matchingAnnotations = allAnnotations.filter {
isAnnotationTargetMatchingDeclaration(it.target, declaration)
}
matchingAnnotations.mapTo(declaration.annotations) {
generateAnnotationConstructorCall(it.annotation)
}
}
fun generateAnnotationConstructorCall(annotationDescriptor: AnnotationDescriptor): IrExpression {
val annotationType = annotationDescriptor.type
val annotationClassDescriptor = annotationType.constructor.declarationDescriptor
?: throw AssertionError("No declaration descriptor for annotation $annotationDescriptor")
assert(DescriptorUtils.isAnnotationClass(annotationClassDescriptor)) {
"Annotation class expected: $annotationClassDescriptor"
}
val primaryConstructorDescriptor =
annotationClassDescriptor.safeAs<ClassDescriptor>()?.unsubstitutedPrimaryConstructor
?: throw AssertionError("No primary constructor for annotation class $annotationClassDescriptor")
val primaryConstructorSymbol = context.symbolTable.referenceConstructor(primaryConstructorDescriptor)
val psi = annotationDescriptor.source.safeAs<PsiSourceElement>()?.psi
val startOffset = psi?.startOffset ?: UNDEFINED_OFFSET
val endOffset = psi?.startOffset ?: UNDEFINED_OFFSET
val irCall = IrCallImpl(
startOffset, endOffset, annotationType,
primaryConstructorSymbol, primaryConstructorDescriptor,
typeArgumentsCount = 0
)
for (valueParameter in primaryConstructorDescriptor.valueParameters) {
val argumentIndex = valueParameter.index
val argumentValue = annotationDescriptor.allValueArguments[valueParameter.name]
?: throw AssertionError("Annotation $annotationDescriptor missing value argument for $valueParameter")
val irArgument =
constantValueGenerator.generateConstantValueAsExpression(
UNDEFINED_OFFSET,
UNDEFINED_OFFSET,
argumentValue,
valueParameter.varargElementType
)
irCall.putValueArgument(argumentIndex, irArgument)
}
return irCall
}
private fun isAnnotationTargetMatchingDeclaration(target: AnnotationUseSiteTarget?, element: IrElement): Boolean =
when (element) {
is IrProperty -> target == null || target == AnnotationUseSiteTarget.PROPERTY
is IrField -> target == AnnotationUseSiteTarget.FIELD
is IrSimpleFunction ->
target == null || element.descriptor.let {
when (it) {
is PropertyGetterDescriptor -> target == AnnotationUseSiteTarget.PROPERTY_GETTER
is PropertySetterDescriptor -> target == AnnotationUseSiteTarget.PROPERTY_SETTER
else -> false
}
}
else -> target == null
}
}
@@ -92,6 +92,7 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
mapClassDeclaration(declaration.descriptor),
declaration.declarations.map { it.transform() }
).apply {
transformAnnotations(declaration)
thisReceiver = declaration.thisReceiver?.withDescriptor(descriptor.thisAsReceiverParameter)
transformTypeParameters(declaration, descriptor.declaredTypeParameters)
@@ -117,7 +118,9 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
declaration.startOffset, declaration.endOffset,
mapDeclarationOrigin(declaration.origin),
mapTypeAliasDeclaration(declaration.descriptor)
)
).apply {
transformAnnotations(declaration)
}
override fun visitSimpleFunction(declaration: IrSimpleFunction): IrFunction =
IrFunctionImpl(
@@ -126,6 +129,7 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
mapFunctionDeclaration(declaration.descriptor),
declaration.body?.transform()
).transformParameters(declaration).apply {
transformAnnotations(declaration)
descriptor.overriddenDescriptors.mapIndexedTo(overriddenSymbols) { index, overriddenDescriptor ->
val oldOverriddenSymbol = declaration.overriddenSymbols.getOrNull(index)
if (overriddenDescriptor.original == oldOverriddenSymbol?.descriptor?.original)
@@ -141,7 +145,9 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
mapDeclarationOrigin(declaration.origin),
mapConstructorDeclaration(declaration.descriptor),
declaration.body?.transform()
).transformParameters(declaration)
).transformParameters(declaration).apply {
transformAnnotations(declaration)
}
protected fun <T : IrTypeParametersContainer> T.transformTypeParameters(
original: T,
@@ -183,6 +189,10 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
}
}
private fun IrAnnotationContainer.transformAnnotations(original: IrAnnotationContainer) {
original.annotations.mapTo(annotations) { it.transform() }
}
protected fun copyTypeParameter(
originalTypeParameter: IrTypeParameter,
newTypeParameterDescriptor: TypeParameterDescriptor
@@ -220,7 +230,9 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
mapDeclarationOrigin(originalValueParameter.origin),
newParameterDescriptor,
originalValueParameter.defaultValue?.transform()
)
).apply {
transformAnnotations(originalValueParameter)
}
// TODO visitTypeParameter
// TODO visitValueParameter
@@ -234,7 +246,9 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
declaration.backingField?.transform(),
declaration.getter?.transform(),
declaration.setter?.transform()
)
).apply {
transformAnnotations(declaration)
}
override fun visitField(declaration: IrField): IrField =
IrFieldImpl(
@@ -242,7 +256,9 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
mapDeclarationOrigin(declaration.origin),
mapPropertyDeclaration(declaration.descriptor),
declaration.initializer?.transform()
)
).apply {
transformAnnotations(declaration)
}
override fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty): IrLocalDelegatedProperty =
IrLocalDelegatedPropertyImpl(
@@ -277,7 +293,9 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
mapDeclarationOrigin(declaration.origin),
mapVariableDeclaration(declaration.descriptor),
declaration.initializer?.transform()
)
).apply {
transformAnnotations(declaration)
}
override fun visitBody(body: IrBody): IrBody =
throw IllegalArgumentException("Unsupported body type: $body")
@@ -86,6 +86,7 @@ open class DeepCopyIrTreeWithSymbols(private val symbolRemapper: SymbolRemapper)
mapDeclarationOrigin(declaration.origin),
symbolRemapper.getDeclaredClass(declaration.symbol)
).apply {
transformAnnotations(declaration)
declaration.superClasses.mapTo(superClasses) {
symbolRemapper.getReferencedClass(it)
}
@@ -99,7 +100,9 @@ open class DeepCopyIrTreeWithSymbols(private val symbolRemapper: SymbolRemapper)
declaration.startOffset, declaration.endOffset,
mapDeclarationOrigin(declaration.origin),
declaration.descriptor
)
).apply {
transformAnnotations(declaration)
}
override fun visitSimpleFunction(declaration: IrSimpleFunction): IrSimpleFunction =
IrFunctionImpl(
@@ -124,6 +127,7 @@ open class DeepCopyIrTreeWithSymbols(private val symbolRemapper: SymbolRemapper)
private fun <T : IrFunction> T.transformFunctionChildren(declaration: T): T =
apply {
transformAnnotations(declaration)
declaration.typeParameters.transformTo(typeParameters)
dispatchReceiverParameter = declaration.dispatchReceiverParameter?.transform()
extensionReceiverParameter = declaration.extensionReceiverParameter?.transform()
@@ -131,6 +135,10 @@ open class DeepCopyIrTreeWithSymbols(private val symbolRemapper: SymbolRemapper)
body = declaration.body?.transform()
}
private fun IrDeclaration.transformAnnotations(declaration: IrDeclaration) {
declaration.annotations.transformTo(annotations)
}
override fun visitProperty(declaration: IrProperty): IrProperty =
IrPropertyImpl(
declaration.startOffset, declaration.endOffset,
@@ -140,7 +148,9 @@ open class DeepCopyIrTreeWithSymbols(private val symbolRemapper: SymbolRemapper)
declaration.backingField?.transform(),
declaration.getter?.transform(),
declaration.setter?.transform()
)
).apply {
transformAnnotations(declaration)
}
override fun visitField(declaration: IrField): IrField =
IrFieldImpl(
@@ -148,6 +158,7 @@ open class DeepCopyIrTreeWithSymbols(private val symbolRemapper: SymbolRemapper)
mapDeclarationOrigin(declaration.origin),
symbolRemapper.getDeclaredField(declaration.symbol)
).apply {
transformAnnotations(declaration)
initializer = declaration.initializer?.transform()
}
@@ -186,6 +197,7 @@ open class DeepCopyIrTreeWithSymbols(private val symbolRemapper: SymbolRemapper)
mapDeclarationOrigin(declaration.origin),
symbolRemapper.getDeclaredVariable(declaration.symbol)
).apply {
transformAnnotations(declaration)
initializer = declaration.initializer?.transform()
}
@@ -206,6 +218,7 @@ open class DeepCopyIrTreeWithSymbols(private val symbolRemapper: SymbolRemapper)
mapDeclarationOrigin(declaration.origin),
symbolRemapper.getDeclaredValueParameter(declaration.symbol)
).apply {
transformAnnotations(declaration)
defaultValue = declaration.defaultValue?.transform()
}
@@ -53,7 +53,12 @@ class DumpIrTreeVisitor(out: Appendable) : IrElementVisitor<Unit, String> {
}
override fun visitElement(element: IrElement, data: String) {
element.dumpLabeledSubTree(data)
element.dumpLabeledElementWith(data) {
if (element is IrAnnotationContainer) {
dumpAnnotations(element)
}
element.acceptChildren(this@DumpIrTreeVisitor, "")
}
}
override fun visitModuleFragment(declaration: IrModuleFragment, data: String) {
@@ -79,6 +84,7 @@ class DumpIrTreeVisitor(out: Appendable) : IrElementVisitor<Unit, String> {
override fun visitClass(declaration: IrClass, data: String) {
declaration.dumpLabeledElementWith(data) {
dumpAnnotations(declaration)
declaration.thisReceiver?.accept(this, "\$this")
declaration.superClasses.renderDeclarationElementsOrDescriptors("superClasses")
declaration.typeParameters.dumpElements()
@@ -88,12 +94,14 @@ class DumpIrTreeVisitor(out: Appendable) : IrElementVisitor<Unit, String> {
override fun visitTypeParameter(declaration: IrTypeParameter, data: String) {
declaration.dumpLabeledElementWith(data) {
dumpAnnotations(declaration)
declaration.superClassifiers.renderDeclarationElementsOrDescriptors("superClassifiers")
}
}
override fun visitSimpleFunction(declaration: IrSimpleFunction, data: String) {
declaration.dumpLabeledElementWith(data) {
dumpAnnotations(declaration)
declaration.overriddenSymbols.renderDeclarationElementsOrDescriptors("overridden")
declaration.typeParameters.dumpElements()
declaration.dispatchReceiverParameter?.accept(this, "\$this")
@@ -103,6 +111,14 @@ class DumpIrTreeVisitor(out: Appendable) : IrElementVisitor<Unit, String> {
}
}
private fun dumpAnnotations(element: IrAnnotationContainer) {
if (element.annotations.isNotEmpty()) {
indented("annotations") {
element.annotations.dumpElements()
}
}
}
private fun Collection<IrSymbol>.renderDeclarationElementsOrDescriptors(caption: String) {
if (isNotEmpty()) {
indented(caption) {
@@ -114,19 +130,19 @@ class DumpIrTreeVisitor(out: Appendable) : IrElementVisitor<Unit, String> {
}
private fun IrSymbol.renderDeclarationElementOrDescriptor(label: String? = null) {
if (isBound)
owner.render(label)
else {
if (label != null) {
when {
isBound ->
owner.render(label)
label != null ->
printer.println("$label: ", "UNBOUND: ", DescriptorRenderer.COMPACT.render(descriptor))
} else {
else ->
printer.println("UNBOUND: ", DescriptorRenderer.COMPACT.render(descriptor))
}
}
}
override fun visitConstructor(declaration: IrConstructor, data: String) {
declaration.dumpLabeledElementWith(data) {
dumpAnnotations(declaration)
declaration.typeParameters.dumpElements()
declaration.dispatchReceiverParameter?.accept(this, "\$outer")
declaration.valueParameters.dumpElements()
@@ -136,6 +152,7 @@ class DumpIrTreeVisitor(out: Appendable) : IrElementVisitor<Unit, String> {
override fun visitProperty(declaration: IrProperty, data: String) {
declaration.dumpLabeledElementWith(data) {
dumpAnnotations(declaration)
declaration.typeParameters.dumpElements()
declaration.backingField?.accept(this, "")
declaration.getter?.accept(this, "")
@@ -156,6 +173,7 @@ class DumpIrTreeVisitor(out: Appendable) : IrElementVisitor<Unit, String> {
override fun visitEnumEntry(declaration: IrEnumEntry, data: String) {
declaration.dumpLabeledElementWith(data) {
dumpAnnotations(declaration)
declaration.initializerExpression?.accept(this, "init")
declaration.correspondingClass?.accept(this, "class")
}
@@ -0,0 +1,7 @@
annotation class A1(val x: Int)
annotation class A2(val a: A1)
annotation class AA(val xs: Array<A1>)
@A2(A1(42))
@AA([A1(1), A1(2)])
fun test() {}
@@ -0,0 +1,100 @@
FILE fqName:<root> fileName:/annotationsInAnnotationArguments.kt
CLASS ANNOTATION_CLASS name:A1 modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:A1 flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:A1 flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Int flags:
PROPERTY name:x type:kotlin.Int visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:A1) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:A1 flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: GET_VAR 'this@A1: A1' type=A1 origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS ANNOTATION_CLASS name:A2 modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:A2 flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (a:A1) returnType:A2 flags:
VALUE_PARAMETER name:a index:0 type:A1 flags:
PROPERTY name:a type:A1 visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:a type:A1 visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter a: A1' type=A1 origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-a> visibility:public modality:FINAL <> ($this:A2) returnType:A1 flags:
$this: VALUE_PARAMETER name:<this> type:A2 flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-a>(): A1'
GET_FIELD 'a: A1' type=A1 origin=null
receiver: GET_VAR 'this@A2: A2' type=A2 origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS ANNOTATION_CLASS name:AA modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:AA flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (xs:kotlin.Array<A1>) returnType:AA flags:
VALUE_PARAMETER name:xs index:0 type:kotlin.Array<A1> flags:
PROPERTY name:xs type:kotlin.Array<A1> visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array<A1> visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter xs: Array<A1>' type=kotlin.Array<A1> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xs> visibility:public modality:FINAL <> ($this:AA) returnType:Array<A1> flags:
$this: VALUE_PARAMETER name:<this> type:AA flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-xs>(): Array<A1>'
GET_FIELD 'xs: Array<A1>' type=kotlin.Array<A1> origin=null
receiver: GET_VAR 'this@AA: AA' type=AA origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN name:test visibility:public modality:FINAL <> () returnType:Unit flags:
annotations:
CALL 'constructor A2(A1)' type=A2 origin=null
a: CALL 'constructor A1(Int)' type=A1 origin=null
x: CONST Int type=kotlin.Int value=42
CALL 'constructor AA(Array<A1>)' type=AA origin=null
xs: VARARG type=Array<A1> varargElementType=A1
CALL 'constructor A1(Int)' type=A1 origin=null
x: CONST Int type=kotlin.Int value=1
CALL 'constructor A1(Int)' type=A1 origin=null
x: CONST Int type=kotlin.Int value=2
BLOCK_BODY
@@ -0,0 +1,10 @@
annotation class TestAnnWithIntArray(val x: IntArray)
annotation class TestAnnWithStringArray(val x: Array<String>)
@TestAnnWithIntArray(intArrayOf(1, 2, 3))
@TestAnnWithStringArray(arrayOf("a", "b", "c"))
fun test1() {}
@TestAnnWithIntArray([4, 5, 6])
@TestAnnWithStringArray(["d", "e", "f"])
fun test2() {}
@@ -0,0 +1,85 @@
FILE fqName:<root> fileName:/arrayInAnnotationArguments.kt
CLASS ANNOTATION_CLASS name:TestAnnWithIntArray modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestAnnWithIntArray flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (x:kotlin.IntArray) returnType:TestAnnWithIntArray flags:
VALUE_PARAMETER name:x index:0 type:kotlin.IntArray flags:
PROPERTY name:x type:kotlin.IntArray visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: IntArray' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:TestAnnWithIntArray) returnType:IntArray flags:
$this: VALUE_PARAMETER name:<this> type:TestAnnWithIntArray flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): IntArray'
GET_FIELD 'x: IntArray' type=kotlin.IntArray origin=null
receiver: GET_VAR 'this@TestAnnWithIntArray: TestAnnWithIntArray' type=TestAnnWithIntArray origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS ANNOTATION_CLASS name:TestAnnWithStringArray modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestAnnWithStringArray flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (x:kotlin.Array<kotlin.String>) returnType:TestAnnWithStringArray flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Array<kotlin.String> flags:
PROPERTY name:x type:kotlin.Array<kotlin.String> visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Array<kotlin.String> visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: Array<String>' type=kotlin.Array<kotlin.String> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:TestAnnWithStringArray) returnType:Array<String> flags:
$this: VALUE_PARAMETER name:<this> type:TestAnnWithStringArray flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Array<String>'
GET_FIELD 'x: Array<String>' type=kotlin.Array<kotlin.String> origin=null
receiver: GET_VAR 'this@TestAnnWithStringArray: TestAnnWithStringArray' type=TestAnnWithStringArray origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN name:test1 visibility:public modality:FINAL <> () returnType:Unit flags:
annotations:
CALL 'constructor TestAnnWithIntArray(IntArray)' type=TestAnnWithIntArray origin=null
x: VARARG type=IntArray varargElementType=Int
CONST Int type=kotlin.Int value=1
CONST Int type=kotlin.Int value=2
CONST Int type=kotlin.Int value=3
CALL 'constructor TestAnnWithStringArray(Array<String>)' type=TestAnnWithStringArray origin=null
x: VARARG type=Array<String> varargElementType=String
CONST String type=kotlin.String value=a
CONST String type=kotlin.String value=b
CONST String type=kotlin.String value=c
BLOCK_BODY
FUN name:test2 visibility:public modality:FINAL <> () returnType:Unit flags:
annotations:
CALL 'constructor TestAnnWithIntArray(IntArray)' type=TestAnnWithIntArray origin=null
x: VARARG type=IntArray varargElementType=Int
CONST Int type=kotlin.Int value=4
CONST Int type=kotlin.Int value=5
CONST Int type=kotlin.Int value=6
CALL 'constructor TestAnnWithStringArray(Array<String>)' type=TestAnnWithStringArray origin=null
x: VARARG type=Array<String> varargElementType=String
CONST String type=kotlin.String value=d
CONST String type=kotlin.String value=e
CONST String type=kotlin.String value=f
BLOCK_BODY
@@ -0,0 +1,21 @@
annotation class TestAnn(val x: String)
@TestAnn("class")
class TestClass
@TestAnn("interface")
interface TestInterface
@TestAnn("object")
object TestObject
class Host {
@TestAnn("companion")
companion object TestCompanion
}
@TestAnn("enum")
enum class TestEnum
@TestAnn("annotation")
annotation class TestAnnotation
@@ -0,0 +1,221 @@
FILE fqName:<root> fileName:/classesWithAnnotations.kt
CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestAnn flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:TestAnn flags:
VALUE_PARAMETER name:x index:0 type:kotlin.String flags:
PROPERTY name:x type:kotlin.String visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: String' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:TestAnn) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:TestAnn flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): String'
GET_FIELD 'x: String' type=kotlin.String origin=null
receiver: GET_VAR 'this@TestAnn: TestAnn' type=TestAnn origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS CLASS name:TestClass modality:FINAL visibility:public flags:
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=class
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestClass flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
CONSTRUCTOR visibility:public <> () returnType:TestClass flags:
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='TestClass'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS INTERFACE name:TestInterface modality:ABSTRACT visibility:public flags:
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=interface
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestInterface flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS OBJECT name:TestObject modality:FINAL visibility:public flags:
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=object
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestObject flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
CONSTRUCTOR visibility:private <> () returnType:TestObject flags:
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='TestObject'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS CLASS name:Host modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:Host flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
CONSTRUCTOR visibility:public <> () returnType:Host flags:
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='Host'
CLASS OBJECT name:TestCompanion modality:FINAL visibility:public flags:companion
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=companion
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:Host.TestCompanion flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
CONSTRUCTOR visibility:private <> () returnType:Host.TestCompanion flags:
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='companion object of HostTestCompanion'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public flags:
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=enum
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestEnum flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Enum modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:private <> () returnType:TestEnum flags:
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'constructor Enum(String, Int)'
<E : Enum<E>>: TestEnum
INSTANCE_INITIALIZER_CALL classDescriptor='TestEnum'
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<TestEnum>) returnType:Any flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<E>) returnType:Any flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<TestEnum> flags:
FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<TestEnum>) returnType:Unit flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<E>) returnType:Unit flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<TestEnum> flags:
FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<TestEnum>) returnType:(java.lang.Class<(TestEnum..TestEnum?)>..java.lang.Class<(TestEnum..TestEnum?)>?) flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<E>) returnType:(java.lang.Class<(E..E?)>..java.lang.Class<(E..E?)>?) flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<TestEnum> flags:
FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<TestEnum>, other:TestEnum) returnType:Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<E>, other:E) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<TestEnum> flags:
VALUE_PARAMETER name:other index:0 type:TestEnum flags:
FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<TestEnum>, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<E>, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<TestEnum> flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<TestEnum>) returnType:Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<E>) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<TestEnum> flags:
PROPERTY FAKE_OVERRIDE name:name type:kotlin.String visibility:public modality:FINAL flags:val
FUN FAKE_OVERRIDE name:<get-name> visibility:public modality:FINAL <> ($this:kotlin.Enum<TestEnum>) returnType:String flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:<get-name> visibility:public modality:FINAL <> ($this:kotlin.Enum<E>) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<TestEnum> flags:
PROPERTY FAKE_OVERRIDE name:ordinal type:kotlin.Int visibility:public modality:FINAL flags:val
FUN FAKE_OVERRIDE name:<get-ordinal> visibility:public modality:FINAL <> ($this:kotlin.Enum<TestEnum>) returnType:Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:<get-ordinal> visibility:public modality:FINAL <> ($this:kotlin.Enum<E>) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<TestEnum> flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<TestEnum>) returnType:String flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<E>) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<TestEnum> flags:
FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:Array<TestEnum> flags:
SYNTHETIC_BODY kind=ENUM_VALUES
FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:TestEnum flags:
VALUE_PARAMETER name:value index:0 type:kotlin.String flags:
SYNTHETIC_BODY kind=ENUM_VALUEOF
CLASS ANNOTATION_CLASS name:TestAnnotation modality:FINAL visibility:public flags:
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=annotation
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestAnnotation flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> () returnType:TestAnnotation flags:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
@@ -0,0 +1,5 @@
annotation class TestAnn(val x: Int)
class TestClass @TestAnn(1) constructor() {
@TestAnn(2) constructor(x: Int) : this()
}
@@ -0,0 +1,61 @@
FILE fqName:<root> fileName:/constructorsWithAnnotations.kt
CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestAnn flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:TestAnn flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Int flags:
PROPERTY name:x type:kotlin.Int visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:TestAnn) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:TestAnn flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: GET_VAR 'this@TestAnn: TestAnn' type=TestAnn origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS CLASS name:TestClass modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestClass flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
CONSTRUCTOR visibility:public <> () returnType:TestClass flags:
annotations:
CALL 'constructor TestAnn(Int)' type=TestAnn origin=null
x: CONST Int type=kotlin.Int value=1
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='TestClass'
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:TestClass flags:
annotations:
CALL 'constructor TestAnn(Int)' type=TestAnn origin=null
x: CONST Int type=kotlin.Int value=2
VALUE_PARAMETER name:x index:0 type:kotlin.Int flags:
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor TestClass()'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
@@ -0,0 +1,6 @@
enum class En { A, B, C, D }
annotation class TestAnn(val x: En)
@TestAnn(En.A)
fun test1() {}
@@ -0,0 +1,97 @@
FILE fqName:<root> fileName:/enumsInAnnotationArguments.kt
CLASS ENUM_CLASS name:En modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:En flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Enum modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:private <> () returnType:En flags:
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'constructor Enum(String, Int)'
<E : Enum<E>>: En
INSTANCE_INITIALIZER_CALL classDescriptor='En'
ENUM_ENTRY name:A
init: ENUM_CONSTRUCTOR_CALL 'constructor En()'
ENUM_ENTRY name:B
init: ENUM_CONSTRUCTOR_CALL 'constructor En()'
ENUM_ENTRY name:C
init: ENUM_CONSTRUCTOR_CALL 'constructor En()'
ENUM_ENTRY name:D
init: ENUM_CONSTRUCTOR_CALL 'constructor En()'
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<En>) returnType:Any flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<E>) returnType:Any flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<En> flags:
FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<En>) returnType:Unit flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<E>) returnType:Unit flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<En> flags:
FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<En>) returnType:(java.lang.Class<(En..En?)>..java.lang.Class<(En..En?)>?) flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<E>) returnType:(java.lang.Class<(E..E?)>..java.lang.Class<(E..E?)>?) flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<En> flags:
FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<En>, other:En) returnType:Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<E>, other:E) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<En> flags:
VALUE_PARAMETER name:other index:0 type:En flags:
FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<En>, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<E>, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<En> flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<En>) returnType:Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<E>) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<En> flags:
PROPERTY FAKE_OVERRIDE name:name type:kotlin.String visibility:public modality:FINAL flags:val
FUN FAKE_OVERRIDE name:<get-name> visibility:public modality:FINAL <> ($this:kotlin.Enum<En>) returnType:String flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:<get-name> visibility:public modality:FINAL <> ($this:kotlin.Enum<E>) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<En> flags:
PROPERTY FAKE_OVERRIDE name:ordinal type:kotlin.Int visibility:public modality:FINAL flags:val
FUN FAKE_OVERRIDE name:<get-ordinal> visibility:public modality:FINAL <> ($this:kotlin.Enum<En>) returnType:Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:<get-ordinal> visibility:public modality:FINAL <> ($this:kotlin.Enum<E>) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<En> flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<En>) returnType:String flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<E>) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<En> flags:
FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:Array<En> flags:
SYNTHETIC_BODY kind=ENUM_VALUES
FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:En flags:
VALUE_PARAMETER name:value index:0 type:kotlin.String flags:
SYNTHETIC_BODY kind=ENUM_VALUEOF
CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestAnn flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (x:En) returnType:TestAnn flags:
VALUE_PARAMETER name:x index:0 type:En flags:
PROPERTY name:x type:En visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:En visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: En' type=En origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:TestAnn) returnType:En flags:
$this: VALUE_PARAMETER name:<this> type:TestAnn flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): En'
GET_FIELD 'x: En' type=En origin=null
receiver: GET_VAR 'this@TestAnn: TestAnn' type=TestAnn origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN name:test1 visibility:public modality:FINAL <> () returnType:Unit flags:
annotations:
CALL 'constructor TestAnn(En)' type=TestAnn origin=null
x: GET_ENUM 'A' type=En
BLOCK_BODY
@@ -0,0 +1,7 @@
annotation class TestAnn(val x: String)
@field:TestAnn("testVal.field")
val testVal = "a val"
@field:TestAnn("testVar.field")
var testVar = "a var"
@@ -0,0 +1,57 @@
FILE fqName:<root> fileName:/fieldsWithAnnotations.kt
CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestAnn flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:TestAnn flags:
VALUE_PARAMETER name:x index:0 type:kotlin.String flags:
PROPERTY name:x type:kotlin.String visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: String' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:TestAnn) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:TestAnn flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): String'
GET_FIELD 'x: String' type=kotlin.String origin=null
receiver: GET_VAR 'this@TestAnn: TestAnn' type=TestAnn origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
PROPERTY name:testVal type:kotlin.String visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:public
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=testVal.field
EXPRESSION_BODY
CONST String type=kotlin.String value=a val
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-testVal> visibility:public modality:FINAL <> () returnType:String flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-testVal>(): String'
GET_FIELD 'testVal: String' type=kotlin.String origin=null
PROPERTY name:testVar type:kotlin.String visibility:public modality:FINAL flags:var
FIELD PROPERTY_BACKING_FIELD name:testVar type:kotlin.String visibility:public
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=testVar.field
EXPRESSION_BODY
CONST String type=kotlin.String value=a var
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-testVar> visibility:public modality:FINAL <> () returnType:String flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-testVar>(): String'
GET_FIELD 'testVar: String' type=kotlin.String origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-testVar> visibility:public modality:FINAL <> (<set-?>:kotlin.String) returnType:Unit flags:
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.String flags:
BLOCK_BODY
SET_FIELD 'testVar: String' type=kotlin.Unit origin=null
value: GET_VAR 'value-parameter <set-?>: String' type=kotlin.String origin=null
@@ -0,0 +1,3 @@
annotation class TestAnn(val x: Int)
@TestAnn(42) fun testSimpleFunction() {}
@@ -0,0 +1,35 @@
FILE fqName:<root> fileName:/functionsWithAnnotations.kt
CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestAnn flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:TestAnn flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Int flags:
PROPERTY name:x type:kotlin.Int visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:TestAnn) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:TestAnn flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: GET_VAR 'this@TestAnn: TestAnn' type=TestAnn origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN name:testSimpleFunction visibility:public modality:FINAL <> () returnType:Unit flags:
annotations:
CALL 'constructor TestAnn(Int)' type=TestAnn origin=null
x: CONST Int type=kotlin.Int value=42
BLOCK_BODY
@@ -0,0 +1,4 @@
annotation class TestAnn(val x: String)
@TestAnn("testVal.property")
val testVal: String = ""
@@ -0,0 +1,41 @@
FILE fqName:<root> fileName:/propertiesWithAnnotations.kt
CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestAnn flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:TestAnn flags:
VALUE_PARAMETER name:x index:0 type:kotlin.String flags:
PROPERTY name:x type:kotlin.String visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: String' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:TestAnn) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:TestAnn flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): String'
GET_FIELD 'x: String' type=kotlin.String origin=null
receiver: GET_VAR 'this@TestAnn: TestAnn' type=TestAnn origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
PROPERTY name:testVal type:kotlin.String visibility:public modality:FINAL flags:val
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=testVal.property
FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:public
EXPRESSION_BODY
CONST String type=kotlin.String value=
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-testVal> visibility:public modality:FINAL <> () returnType:String flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-testVal>(): String'
GET_FIELD 'testVal: String' type=kotlin.String origin=null
@@ -0,0 +1,15 @@
annotation class TestAnn(val x: String)
val test1: String
@TestAnn("test1.get") get() = ""
var test2: String
@TestAnn("test2.get") get() = ""
@TestAnn("test2.set") set(value) {}
@get:TestAnn("test3.get")
val test3: String = ""
@get:TestAnn("test4.get")
@set:TestAnn("test4.set")
var test4: String = ""
@@ -0,0 +1,82 @@
FILE fqName:<root> fileName:/propertyAccessorsWithAnnotations.kt
CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestAnn flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:TestAnn flags:
VALUE_PARAMETER name:x index:0 type:kotlin.String flags:
PROPERTY name:x type:kotlin.String visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: String' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:TestAnn) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:TestAnn flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): String'
GET_FIELD 'x: String' type=kotlin.String origin=null
receiver: GET_VAR 'this@TestAnn: TestAnn' type=TestAnn origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
PROPERTY name:test1 type:kotlin.String visibility:public modality:FINAL flags:val
FUN name:<get-test1> visibility:public modality:FINAL <> () returnType:String flags:
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=test1.get
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test1>(): String'
CONST String type=kotlin.String value=
PROPERTY name:test2 type:kotlin.String visibility:public modality:FINAL flags:var
FUN name:<get-test2> visibility:public modality:FINAL <> () returnType:String flags:
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=test2.get
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test2>(): String'
CONST String type=kotlin.String value=
FUN name:<set-test2> visibility:public modality:FINAL <> (value:kotlin.String) returnType:Unit flags:
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=test2.set
VALUE_PARAMETER name:value index:0 type:kotlin.String flags:
BLOCK_BODY
PROPERTY name:test3 type:kotlin.String visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.String visibility:public
EXPRESSION_BODY
CONST String type=kotlin.String value=
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test3> visibility:public modality:FINAL <> () returnType:String flags:
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=test3.get
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test3>(): String'
GET_FIELD 'test3: String' type=kotlin.String origin=null
PROPERTY name:test4 type:kotlin.String visibility:public modality:FINAL flags:var
FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.String visibility:public
EXPRESSION_BODY
CONST String type=kotlin.String value=
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test4> visibility:public modality:FINAL <> () returnType:String flags:
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=test4.get
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test4>(): String'
GET_FIELD 'test4: String' type=kotlin.String origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-test4> visibility:public modality:FINAL <> (<set-?>:kotlin.String) returnType:Unit flags:
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=test4.set
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.String flags:
BLOCK_BODY
SET_FIELD 'test4: String' type=kotlin.Unit origin=null
value: GET_VAR 'value-parameter <set-?>: String' type=kotlin.String origin=null
@@ -0,0 +1,5 @@
@Target(AnnotationTarget.TYPEALIAS)
annotation class TestAnn(val x: String)
@TestAnn("TestTypeAlias")
typealias TestTypeAlias = String
@@ -0,0 +1,38 @@
FILE fqName:<root> fileName:/typeAliasesWithAnnotations.kt
CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public flags:
annotations:
CALL 'constructor Target(vararg AnnotationTarget)' type=kotlin.annotation.Target origin=null
allowedTargets: VARARG type=Array<out AnnotationTarget> varargElementType=AnnotationTarget
GET_ENUM 'TYPEALIAS' type=kotlin.annotation.AnnotationTarget
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestAnn flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:TestAnn flags:
VALUE_PARAMETER name:x index:0 type:kotlin.String flags:
PROPERTY name:x type:kotlin.String visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: String' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:TestAnn) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:TestAnn flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): String'
GET_FIELD 'x: String' type=kotlin.String origin=null
receiver: GET_VAR 'this@TestAnn: TestAnn' type=TestAnn origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
TYPEALIAS typealias TestTypeAlias = String type=kotlin.String
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=TestTypeAlias
@@ -0,0 +1,7 @@
annotation class TestAnn(val x: String)
fun testFun(@TestAnn("testFun.x") x: Int) {}
class TestClassConstructor1(@TestAnn("TestClassConstructor1.x")x: Int) {
val xx = x
}
@@ -0,0 +1,71 @@
FILE fqName:<root> fileName:/valueParametersWithAnnotations.kt
CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestAnn flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:TestAnn flags:
VALUE_PARAMETER name:x index:0 type:kotlin.String flags:
PROPERTY name:x type:kotlin.String visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: String' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:TestAnn) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:TestAnn flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): String'
GET_FIELD 'x: String' type=kotlin.String origin=null
receiver: GET_VAR 'this@TestAnn: TestAnn' type=TestAnn origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN name:testFun visibility:public modality:FINAL <> (x:kotlin.Int) returnType:Unit flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Int flags:
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=testFun.x
BLOCK_BODY
CLASS CLASS name:TestClassConstructor1 modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestClassConstructor1 flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:TestClassConstructor1 flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Int flags:
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=TestClassConstructor1.x
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='TestClassConstructor1'
PROPERTY name:xx type:kotlin.Int visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xx> visibility:public modality:FINAL <> ($this:TestClassConstructor1) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:TestClassConstructor1 flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-xx>(): Int'
GET_FIELD 'xx: Int' type=kotlin.Int origin=null
receiver: GET_VAR 'this@TestClassConstructor1: TestClassConstructor1' type=TestClassConstructor1 origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
@@ -0,0 +1,13 @@
annotation class A1(vararg val xs: Int)
annotation class A2(vararg val xs: String)
annotation class AA(vararg val xs: A1)
@A1(1, 2, 3)
@A2("a", "b", "c")
@AA(A1(4), A1(5), A1(6))
fun test1() {}
@A1()
@A2()
@AA()
fun test2() {}
@@ -0,0 +1,121 @@
FILE fqName:<root> fileName:/varargsInAnnotationArguments.kt
CLASS ANNOTATION_CLASS name:A1 modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:A1 flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:A1 flags:
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int flags:vararg
PROPERTY name:xs type:kotlin.IntArray visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.IntArray visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter vararg xs: Int' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xs> visibility:public modality:FINAL <> ($this:A1) returnType:IntArray flags:
$this: VALUE_PARAMETER name:<this> type:A1 flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-xs>(): IntArray'
GET_FIELD 'xs: IntArray' type=kotlin.IntArray origin=null
receiver: GET_VAR 'this@A1: A1' type=A1 origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS ANNOTATION_CLASS name:A2 modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:A2 flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (xs:kotlin.Array<out kotlin.String>) returnType:A2 flags:
VALUE_PARAMETER name:xs index:0 type:kotlin.Array<out kotlin.String> varargElementType:kotlin.String flags:vararg
PROPERTY name:xs type:kotlin.Array<out kotlin.String> visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array<out kotlin.String> visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter vararg xs: String' type=kotlin.Array<out kotlin.String> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xs> visibility:public modality:FINAL <> ($this:A2) returnType:Array<out String> flags:
$this: VALUE_PARAMETER name:<this> type:A2 flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-xs>(): Array<out String>'
GET_FIELD 'xs: Array<out String>' type=kotlin.Array<out kotlin.String> origin=null
receiver: GET_VAR 'this@A2: A2' type=A2 origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
CLASS ANNOTATION_CLASS name:AA modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:AA flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (xs:kotlin.Array<out A1>) returnType:AA flags:
VALUE_PARAMETER name:xs index:0 type:kotlin.Array<out A1> varargElementType:A1 flags:vararg
PROPERTY name:xs type:kotlin.Array<out A1> visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array<out A1> visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter vararg xs: A1' type=kotlin.Array<out A1> origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xs> visibility:public modality:FINAL <> ($this:AA) returnType:Array<out A1> flags:
$this: VALUE_PARAMETER name:<this> type:AA flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-xs>(): Array<out A1>'
GET_FIELD 'xs: Array<out A1>' type=kotlin.Array<out A1> origin=null
receiver: GET_VAR 'this@AA: AA' type=AA origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN name:test1 visibility:public modality:FINAL <> () returnType:Unit flags:
annotations:
CALL 'constructor A1(vararg Int)' type=A1 origin=null
xs: VARARG type=IntArray varargElementType=Int
CONST Int type=kotlin.Int value=1
CONST Int type=kotlin.Int value=2
CONST Int type=kotlin.Int value=3
CALL 'constructor A2(vararg String)' type=A2 origin=null
xs: VARARG type=Array<out String> varargElementType=String
CONST String type=kotlin.String value=a
CONST String type=kotlin.String value=b
CONST String type=kotlin.String value=c
CALL 'constructor AA(vararg A1)' type=AA origin=null
xs: VARARG type=Array<out A1> varargElementType=A1
CALL 'constructor A1(vararg Int)' type=A1 origin=null
xs: VARARG type=IntArray varargElementType=Int
CONST Int type=kotlin.Int value=4
CALL 'constructor A1(vararg Int)' type=A1 origin=null
xs: VARARG type=IntArray varargElementType=Int
CONST Int type=kotlin.Int value=5
CALL 'constructor A1(vararg Int)' type=A1 origin=null
xs: VARARG type=IntArray varargElementType=Int
CONST Int type=kotlin.Int value=6
BLOCK_BODY
FUN name:test2 visibility:public modality:FINAL <> () returnType:Unit flags:
annotations:
CALL 'constructor A1(vararg Int)' type=A1 origin=null
xs: VARARG type=IntArray varargElementType=Int
CALL 'constructor A2(vararg String)' type=A2 origin=null
xs: VARARG type=Array<out String> varargElementType=String
CALL 'constructor AA(vararg A1)' type=AA origin=null
xs: VARARG type=Array<out A1> varargElementType=A1
BLOCK_BODY
@@ -0,0 +1,9 @@
annotation class TestAnn(val x: String)
fun foo() {
@TestAnn("foo/testVal")
val testVal = "testVal"
@TestAnn("foo/testVar")
var testVar = "testVar"
}
@@ -0,0 +1,42 @@
FILE fqName:<root> fileName:/variablesWithAnnotations.kt
CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:TestAnn flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Annotation modality:ABSTRACT visibility:public flags:
CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:TestAnn flags:
VALUE_PARAMETER name:x index:0 type:kotlin.String flags:
PROPERTY name:x type:kotlin.String visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter x: String' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:TestAnn) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:TestAnn flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): String'
GET_FIELD 'x: String' type=kotlin.String origin=null
receiver: GET_VAR 'this@TestAnn: TestAnn' type=TestAnn origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
overridden:
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
overridden:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
overridden:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN name:foo visibility:public modality:FINAL <> () returnType:Unit flags:
BLOCK_BODY
VAR name:testVal type:kotlin.String flags:val
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=foo/testVal
CONST String type=kotlin.String value=testVal
VAR name:testVar type:kotlin.String flags:var
annotations:
CALL 'constructor TestAnn(String)' type=TestAnn origin=null
x: CONST String type=kotlin.String value=foo/testVar
CONST String type=kotlin.String value=testVar
@@ -330,6 +330,93 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
doTest(fileName);
}
@TestMetadata("compiler/testData/ir/irText/declarations/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Annotations extends AbstractIrTextTestCase {
public void testAllFilesPresentInAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/declarations/annotations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("annotationsInAnnotationArguments.kt")
public void testAnnotationsInAnnotationArguments() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.kt");
doTest(fileName);
}
@TestMetadata("arrayInAnnotationArguments.kt")
public void testArrayInAnnotationArguments() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.kt");
doTest(fileName);
}
@TestMetadata("classesWithAnnotations.kt")
public void testClassesWithAnnotations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt");
doTest(fileName);
}
@TestMetadata("constructorsWithAnnotations.kt")
public void testConstructorsWithAnnotations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.kt");
doTest(fileName);
}
@TestMetadata("enumsInAnnotationArguments.kt")
public void testEnumsInAnnotationArguments() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt");
doTest(fileName);
}
@TestMetadata("fieldsWithAnnotations.kt")
public void testFieldsWithAnnotations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt");
doTest(fileName);
}
@TestMetadata("functionsWithAnnotations.kt")
public void testFunctionsWithAnnotations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.kt");
doTest(fileName);
}
@TestMetadata("propertiesWithAnnotations.kt")
public void testPropertiesWithAnnotations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt");
doTest(fileName);
}
@TestMetadata("propertyAccessorsWithAnnotations.kt")
public void testPropertyAccessorsWithAnnotations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt");
doTest(fileName);
}
@TestMetadata("typeAliasesWithAnnotations.kt")
public void testTypeAliasesWithAnnotations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.kt");
doTest(fileName);
}
@TestMetadata("valueParametersWithAnnotations.kt")
public void testValueParametersWithAnnotations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.kt");
doTest(fileName);
}
@TestMetadata("varargsInAnnotationArguments.kt")
public void testVarargsInAnnotationArguments() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.kt");
doTest(fileName);
}
@TestMetadata("variablesWithAnnotations.kt")
public void testVariablesWithAnnotations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/ir/irText/declarations/multiplatform")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)