[K2 plugin] Support simple arguments in annotation metadata extension.

^KT-58968
^KT-60051 Fixed
This commit is contained in:
Mads Ager
2023-06-29 16:01:40 +02:00
committed by teamcity
parent 96b44e0ad8
commit 607d38f96f
6 changed files with 109 additions and 27 deletions
@@ -10,6 +10,8 @@ import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.declarations.utils.classId
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
import org.jetbrains.kotlin.fir.expressions.builder.buildAnnotation
import org.jetbrains.kotlin.fir.expressions.builder.buildAnnotationArgumentMapping
import org.jetbrains.kotlin.fir.expressions.builder.buildConstExpression
import org.jetbrains.kotlin.fir.expressions.impl.FirEmptyAnnotationArgumentMapping
import org.jetbrains.kotlin.fir.packageFqName
import org.jetbrains.kotlin.fir.resolve.providers.firProvider
@@ -21,18 +23,30 @@ import org.jetbrains.kotlin.fir.types.toFirResolvedTypeRef
import org.jetbrains.kotlin.fir.types.toLookupTag
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
import org.jetbrains.kotlin.ir.declarations.nameWithPackage
import org.jetbrains.kotlin.ir.expressions.IrConst
import org.jetbrains.kotlin.ir.expressions.IrConstKind
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.ConstantValueKind
import org.jetbrains.kotlin.utils.addToStdlib.runIf
class Fir2IrAnnotationsFromPluginRegistrar(private val components: Fir2IrComponents) : IrAnnotationsFromPluginRegistrar() {
private val generatedIrDeclarationsByFileByOffset = mutableMapOf<String, MutableMap<Pair<Int, Int>, MutableList<IrConstructorCall>>>()
private fun IrConstructorCall.hasOnlySupportedAnnotationArgumentTypes(): Boolean {
for (i in 0 until valueArgumentsCount) {
if (getValueArgument(i) !is IrConst<*>) {
return false
}
}
return true
}
override fun addMetadataVisibleAnnotationsToElement(declaration: IrDeclaration, annotations: List<IrConstructorCall>) {
require(annotations.all { it.valueArgumentsCount == 0 && it.typeArgumentsCount == 0 }) {
"Saving annotations with arguments from IR to metadata is not supported yet. See KT-58968"
require(annotations.all { it.typeArgumentsCount == 0 && it.hasOnlySupportedAnnotationArgumentTypes() }) {
"Saving annotations with arguments from IR to metadata is only supported for basic constants. See KT-58968"
}
annotations.forEach {
require(it.symbol.owner.constructedClass.isAnnotationClass) { "${it.render()} is not an annotation constructor call" }
@@ -98,7 +112,24 @@ class Fir2IrAnnotationsFromPluginRegistrar(private val components: Fir2IrCompone
.toLookupTag()
.constructClassType(typeArguments = emptyArray(), isNullable = false)
.toFirResolvedTypeRef()
argumentMapping = FirEmptyAnnotationArgumentMapping
argumentMapping = buildAnnotationArgumentMapping {
for (i in 0 until this@toFirAnnotation.valueArgumentsCount) {
val name = this@toFirAnnotation.symbol.owner.valueParameters[i].name
val argument = this@toFirAnnotation.getValueArgument(i) as IrConst<*>
this.mapping[name] = when (argument.kind) {
IrConstKind.Boolean -> buildConstExpression(source = null, ConstantValueKind.Boolean, argument.value as Boolean)
IrConstKind.Byte -> buildConstExpression(source = null, ConstantValueKind.Byte, argument.value as Byte)
IrConstKind.Char -> buildConstExpression(source = null, ConstantValueKind.Char, argument.value as Char)
IrConstKind.Double -> buildConstExpression(source = null, ConstantValueKind.Double, argument.value as Double)
IrConstKind.Float -> buildConstExpression(source = null, ConstantValueKind.Float, argument.value as Float)
IrConstKind.Int -> buildConstExpression(source = null, ConstantValueKind.Int, argument.value as Int)
IrConstKind.Long -> buildConstExpression(source = null, ConstantValueKind.Long, argument.value as Long)
IrConstKind.Null -> buildConstExpression(source = null, ConstantValueKind.Null, null)
IrConstKind.Short -> buildConstExpression(source = null, ConstantValueKind.Short, argument.value as Short)
IrConstKind.String -> buildConstExpression(source = null, ConstantValueKind.String, argument.value as String)
}
}
}
}
}
}
@@ -42,4 +42,14 @@ annotation class AllPropertiesConstructor
annotation class AddAnnotations
annotation class AnnotationToAdd
annotation class AnnotationToAdd(
val booleanValue: Boolean,
val byteValue: Byte,
val charValue: Char,
val doubleValue: Double,
val floatValue: Float,
val intValue: Int,
val longValue: Long,
val shortValue: Short,
val stringValue: String
)
@@ -7,7 +7,11 @@ package org.jetbrains.kotlin.ir.plugin
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.expressions.IrConst
import org.jetbrains.kotlin.ir.expressions.IrConstKind
import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl
import org.jetbrains.kotlin.ir.types.defaultType
import org.jetbrains.kotlin.ir.util.constructors
@@ -66,7 +70,44 @@ class TransformerForAddingAnnotations(val context: IrPluginContext) : IrElementV
val annotationCall = IrConstructorCallImpl.fromSymbolOwner(
type = annotationClass.defaultType,
constructorSymbol = annotationConstructor.symbol
)
).also {
it.putValueArgument(
0,
IrConstImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, context.irBuiltIns.booleanType, IrConstKind.Boolean, true)
)
it.putValueArgument(
1,
IrConstImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, context.irBuiltIns.byteType, IrConstKind.Byte, 1)
)
it.putValueArgument(
2,
IrConstImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, context.irBuiltIns.charType, IrConstKind.Char, 'c')
)
it.putValueArgument(
3,
IrConstImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, context.irBuiltIns.doubleType, IrConstKind.Double, 4.2)
)
it.putValueArgument(
4,
IrConstImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, context.irBuiltIns.floatType, IrConstKind.Float, 2.4f)
)
it.putValueArgument(
5,
IrConstImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, context.irBuiltIns.intType, IrConstKind.Int, 42)
)
it.putValueArgument(
6,
IrConstImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, context.irBuiltIns.longType, IrConstKind.Long, 24L)
)
it.putValueArgument(
7,
IrConstImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, context.irBuiltIns.shortType, IrConstKind.Short, 7)
)
it.putValueArgument(
8,
IrConstImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, context.irBuiltIns.stringType, IrConstKind.String, "OK")
)
}
context.annotationsRegistrar.addMetadataVisibleAnnotationsToElement(declaration, annotationCall)
}
}
@@ -1,13 +1,13 @@
@R|org/jetbrains/kotlin/fir/plugin/AddAnnotations|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public final class Some : R|kotlin/Any| {
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public final fun foo(): R|kotlin/Unit|
@R|org/jetbrains/kotlin/fir/plugin/AddAnnotations|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public final class Some : R|kotlin/Any| {
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public final fun foo(): R|kotlin/Unit|
@PROPERTY:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() field:@FIELD:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public final val x: R|kotlin/Int|
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public get(): R|kotlin/Int|
@PROPERTY:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) field:@FIELD:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public final val x: R|kotlin/Int|
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public get(): R|kotlin/Int|
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public constructor(@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() x: R|kotlin/Int|): R|test/Some|
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public constructor(@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) x: R|kotlin/Int|): R|test/Some|
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public final class Derived : R|kotlin/Any| {
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public constructor(): R|test/Some.Derived|
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public final class Derived : R|kotlin/Any| {
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public constructor(): R|test/Some.Derived|
}
@@ -1,13 +1,13 @@
@R|org/jetbrains/kotlin/fir/plugin/AddAnnotations|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public final class Some : R|kotlin/Any| {
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public final fun foo(): R|kotlin/Unit|
@R|org/jetbrains/kotlin/fir/plugin/AddAnnotations|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public final class Some : R|kotlin/Any| {
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public final fun foo(): R|kotlin/Unit|
@PROPERTY:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @PROPERTY:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @PROPERTY:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @PROPERTY:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @PROPERTY:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public final val x: R|kotlin/Int|
@PROPERTY_GETTER:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @PROPERTY_GETTER:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @PROPERTY_GETTER:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @PROPERTY_GETTER:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @PROPERTY_GETTER:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public get(): R|kotlin/Int|
@PROPERTY:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @PROPERTY:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @PROPERTY:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @PROPERTY:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @PROPERTY:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public final val x: R|kotlin/Int|
@PROPERTY_GETTER:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @PROPERTY_GETTER:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @PROPERTY_GETTER:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @PROPERTY_GETTER:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @PROPERTY_GETTER:R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public get(): R|kotlin/Int|
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public constructor(@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() x: R|kotlin/Int|): R|test/Some|
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public constructor(@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) x: R|kotlin/Int|): R|test/Some|
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public final class Derived : R|kotlin/Any| {
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|() public constructor(): R|test/Some.Derived|
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public final class Derived : R|kotlin/Any| {
@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public constructor(): R|test/Some.Derived|
}
@@ -1,28 +1,28 @@
package test
@AddAnnotations
@AnnotationToAdd
@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK")
class Some {
@AnnotationToAdd
constructor(@AnnotationToAdd x: Int) /* primary */ {
@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK")
constructor(@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK") x: Int) /* primary */ {
super/*Any*/()
/* <init>() */
}
@AnnotationToAdd
@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK")
val x: Int
field = x
@AnnotationToAdd
@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK")
get
@AnnotationToAdd
@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK")
fun foo() {
}
@AnnotationToAdd
@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK")
class Derived {
@AnnotationToAdd
@AnnotationToAdd(booleanValue = true, byteValue = 1B, charValue = 'c', doubleValue = 4.2, floatValue = 2.4F, intValue = 42, longValue = 24L, shortValue = 7S, stringValue = "OK")
constructor() /* primary */ {
super/*Any*/()
/* <init>() */