[FIR2IR] Fix infinite loop between annotation and annotation parameter
When an annotation constructor value parameter is annotated with the very same annotation, FIR2IR went in an infinite loop when trying to generate it. To fix this, the constructor is added to the Fir2IrDeclarationStorage cache before generating the value parameters. To accommodate for the missing parameters, the value arguments count is determined using the FIR.
This commit is contained in:
committed by
Space Team
parent
fc75402f65
commit
d1ce55cbd2
+6
@@ -78,6 +78,12 @@ public class FirLoadK1CompiledKotlinGenerated extends AbstractFirLoadK1CompiledK
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/PrimitiveArrayArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/SelfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SimpleAnnotation.kt")
|
||||
public void testSimpleAnnotation() throws Exception {
|
||||
|
||||
+6
@@ -78,6 +78,12 @@ public class FirLoadK2CompiledKotlinGenerated extends AbstractFirLoadK2CompiledK
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/PrimitiveArrayArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/SelfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SimpleAnnotation.kt")
|
||||
public void testSimpleAnnotation() throws Exception {
|
||||
|
||||
+4
-3
@@ -661,7 +661,7 @@ class Fir2IrDeclarationStorage(
|
||||
signatureComposer.composeSignature(constructor, forceTopLevelPrivate = forceTopLevelPrivate)
|
||||
}
|
||||
val visibility = if (irParent.isAnonymousObject) Visibilities.Public else constructor.visibility
|
||||
val created = constructor.convertWithOffsets { startOffset, endOffset ->
|
||||
return constructor.convertWithOffsets { startOffset, endOffset ->
|
||||
declareIrConstructor(signature) { symbol ->
|
||||
classifierStorage.preCacheTypeParameters(constructor, symbol)
|
||||
irFactory.createConstructor(
|
||||
@@ -671,14 +671,15 @@ class Fir2IrDeclarationStorage(
|
||||
isInline = false, isExternal = false, isPrimary = isPrimary, isExpect = constructor.isExpect
|
||||
).apply {
|
||||
metadata = FirMetadataSource.Function(constructor)
|
||||
// Add to cache before generating parameters to prevent an infinite loop when an annotation value parameter is annotated
|
||||
// with the annotation itself.
|
||||
constructorCache[constructor] = this
|
||||
enterScope(this)
|
||||
bindAndDeclareParameters(constructor, irParent, isStatic = false, forSetter = false)
|
||||
leaveScope(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
constructorCache[constructor] = created
|
||||
return created
|
||||
}
|
||||
|
||||
fun getOrCreateIrConstructor(
|
||||
|
||||
+39
-45
@@ -645,52 +645,46 @@ class CallAndReferenceGenerator(
|
||||
val type = coneType?.toIrType()
|
||||
val symbol = type?.classifierOrNull
|
||||
val irConstructorCall = annotation.convertWithOffsets { startOffset, endOffset ->
|
||||
when (symbol) {
|
||||
is IrClassSymbol -> {
|
||||
val irClass = symbol.owner
|
||||
val irConstructor = (annotation.toResolvedCallableSymbol() as? FirConstructorSymbol)?.let {
|
||||
this.declarationStorage.getIrConstructorSymbol(it)
|
||||
} ?: run {
|
||||
// Fallback for FirReferencePlaceholderForResolvedAnnotations from jar
|
||||
val fir = coneType.lookupTag.toSymbol(session)?.fir as? FirClass
|
||||
var constructorSymbol: FirConstructorSymbol? = null
|
||||
fir?.unsubstitutedScope(
|
||||
session,
|
||||
scopeSession,
|
||||
withForcedTypeCalculator = true,
|
||||
memberRequiredPhase = null,
|
||||
)?.processDeclaredConstructors {
|
||||
if (it.fir.isPrimary && constructorSymbol == null) {
|
||||
constructorSymbol = it
|
||||
}
|
||||
}
|
||||
|
||||
constructorSymbol?.let {
|
||||
this.declarationStorage.getIrConstructorSymbol(it)
|
||||
}
|
||||
}
|
||||
if (irConstructor == null) {
|
||||
IrErrorCallExpressionImpl(startOffset, endOffset, type, "No annotation constructor found: ${irClass.name}")
|
||||
} else {
|
||||
IrConstructorCallImpl(
|
||||
startOffset, endOffset, type, irConstructor,
|
||||
valueArgumentsCount = irConstructor.owner.valueParameters.size,
|
||||
typeArgumentsCount = annotation.typeArguments.size,
|
||||
constructorTypeArgumentsCount = 0
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else -> {
|
||||
IrErrorCallExpressionImpl(
|
||||
startOffset,
|
||||
endOffset,
|
||||
type ?: createErrorType(),
|
||||
"Unresolved reference: ${annotation.render()}"
|
||||
)
|
||||
}
|
||||
if (symbol !is IrClassSymbol) {
|
||||
return@convertWithOffsets IrErrorCallExpressionImpl(
|
||||
startOffset, endOffset, type ?: createErrorType(), "Unresolved reference: ${annotation.render()}"
|
||||
)
|
||||
}
|
||||
|
||||
val irClass = symbol.owner
|
||||
val firConstructorSymbol = annotation.toResolvedCallableSymbol() as? FirConstructorSymbol
|
||||
?: run {
|
||||
// Fallback for FirReferencePlaceholderForResolvedAnnotations from jar
|
||||
val fir = coneType.lookupTag.toSymbol(session)?.fir as? FirClass
|
||||
var constructorSymbol: FirConstructorSymbol? = null
|
||||
fir?.unsubstitutedScope(
|
||||
session,
|
||||
scopeSession,
|
||||
withForcedTypeCalculator = true,
|
||||
memberRequiredPhase = null,
|
||||
)?.processDeclaredConstructors {
|
||||
if (it.fir.isPrimary && constructorSymbol == null) {
|
||||
constructorSymbol = it
|
||||
}
|
||||
}
|
||||
constructorSymbol
|
||||
} ?: return@convertWithOffsets IrErrorCallExpressionImpl(
|
||||
startOffset, endOffset, type, "No annotation constructor found: ${irClass.name}"
|
||||
)
|
||||
|
||||
val irConstructor = declarationStorage.getIrConstructorSymbol(firConstructorSymbol)
|
||||
|
||||
IrConstructorCallImpl(
|
||||
startOffset, endOffset, type, irConstructor,
|
||||
// Get the number of value arguments from FIR because of a possible cycle where an annotation constructor
|
||||
// parameter is annotated with the same annotation.
|
||||
// In this case, the IR value parameters won't be initialized yet, and we will get 0 from
|
||||
// `irConstructor.owner.valueParameters.size`.
|
||||
// See KT-58294
|
||||
valueArgumentsCount = firConstructorSymbol.valueParameterSymbols.size,
|
||||
typeArgumentsCount = annotation.typeArguments.size,
|
||||
constructorTypeArgumentsCount = 0
|
||||
)
|
||||
}
|
||||
return visitor.withAnnotationMode {
|
||||
val annotationCall = annotation.toAnnotationCall()
|
||||
|
||||
+6
@@ -377,6 +377,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
||||
runTest("compiler/testData/codegen/box/annotations/retentionInJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("singleAssignmentToVarargInAnnotation.kt")
|
||||
public void testSingleAssignmentToVarargInAnnotation() throws Exception {
|
||||
|
||||
+6
@@ -377,6 +377,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
||||
runTest("compiler/testData/codegen/box/annotations/retentionInJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("singleAssignmentToVarargInAnnotation.kt")
|
||||
public void testSingleAssignmentToVarargInAnnotation() throws Exception {
|
||||
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
FILE fqName:<root> fileName:/selfReferentialAnnotation.kt
|
||||
CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Ann
|
||||
CONSTRUCTOR visibility:public <> (e:kotlin.Int) returnType:<root>.Ann [primary]
|
||||
VALUE_PARAMETER name:e index:0 type:kotlin.Int
|
||||
annotations:
|
||||
Ann(e = '1')
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation]'
|
||||
PROPERTY name:e visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:e type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'e: kotlin.Int declared in <root>.Ann.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-e> visibility:public modality:FINAL <> ($this:<root>.Ann) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:e visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Ann
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-e> (): kotlin.Int declared in <root>.Ann'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:e type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Ann declared in <root>.Ann.<get-e>' type=<root>.Ann origin=null
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.Annotation
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Annotation
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String [fake_override] declared in kotlin.Annotation
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS ANNOTATION_CLASS name:MyRequiresOptIn modality:OPEN visibility:public superTypes:[kotlin.Annotation]
|
||||
annotations:
|
||||
MyRequiresOptIn(a = '', b = GET_ENUM 'ENUM_ENTRY name:ERROR' type=<root>.MyRequiresOptIn.MyLevel)
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyRequiresOptIn
|
||||
CONSTRUCTOR visibility:public <> (a:kotlin.String, b:<root>.MyRequiresOptIn.MyLevel) returnType:<root>.MyRequiresOptIn [primary]
|
||||
VALUE_PARAMETER name:a index:0 type:kotlin.String
|
||||
EXPRESSION_BODY
|
||||
CONST String type=kotlin.String value=""
|
||||
VALUE_PARAMETER name:b index:1 type:<root>.MyRequiresOptIn.MyLevel
|
||||
annotations:
|
||||
MyRequiresOptIn(a = '', b = GET_ENUM 'ENUM_ENTRY name:WARNING' type=<root>.MyRequiresOptIn.MyLevel)
|
||||
EXPRESSION_BODY
|
||||
GET_ENUM 'ENUM_ENTRY name:ERROR' type=<root>.MyRequiresOptIn.MyLevel
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:MyRequiresOptIn modality:OPEN visibility:public superTypes:[kotlin.Annotation]'
|
||||
PROPERTY name:a visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'a: kotlin.String declared in <root>.MyRequiresOptIn.<init>' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-a> visibility:public modality:FINAL <> ($this:<root>.MyRequiresOptIn) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.MyRequiresOptIn
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-a> (): kotlin.String declared in <root>.MyRequiresOptIn'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyRequiresOptIn declared in <root>.MyRequiresOptIn.<get-a>' type=<root>.MyRequiresOptIn origin=null
|
||||
PROPERTY name:b visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:b type:<root>.MyRequiresOptIn.MyLevel visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'b: <root>.MyRequiresOptIn.MyLevel declared in <root>.MyRequiresOptIn.<init>' type=<root>.MyRequiresOptIn.MyLevel origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-b> visibility:public modality:FINAL <> ($this:<root>.MyRequiresOptIn) returnType:<root>.MyRequiresOptIn.MyLevel
|
||||
correspondingProperty: PROPERTY name:b visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.MyRequiresOptIn
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-b> (): <root>.MyRequiresOptIn.MyLevel declared in <root>.MyRequiresOptIn'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:<root>.MyRequiresOptIn.MyLevel visibility:private [final]' type=<root>.MyRequiresOptIn.MyLevel origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyRequiresOptIn declared in <root>.MyRequiresOptIn.<get-b>' type=<root>.MyRequiresOptIn origin=null
|
||||
CLASS ENUM_CLASS name:MyLevel modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyRequiresOptIn.MyLevel
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.MyRequiresOptIn.MyLevel [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
|
||||
<E>: <root>.MyRequiresOptIn.MyLevel
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyLevel modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>]'
|
||||
ENUM_ENTRY name:WARNING
|
||||
init: EXPRESSION_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyRequiresOptIn.MyLevel'
|
||||
ENUM_ENTRY name:ERROR
|
||||
init: EXPRESSION_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyRequiresOptIn.MyLevel'
|
||||
FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<<root>.MyRequiresOptIn.MyLevel>
|
||||
SYNTHETIC_BODY kind=ENUM_VALUES
|
||||
FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:<root>.MyRequiresOptIn.MyLevel
|
||||
VALUE_PARAMETER name:value index:0 type:kotlin.String
|
||||
SYNTHETIC_BODY kind=ENUM_VALUEOF
|
||||
PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val]
|
||||
FUN ENUM_CLASS_SPECIAL_MEMBER name:<get-entries> visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<<root>.MyRequiresOptIn.MyLevel>
|
||||
correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val]
|
||||
SYNTHETIC_BODY kind=ENUM_ENTRIES
|
||||
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Any [fake_override]
|
||||
overridden:
|
||||
protected final fun clone (): kotlin.Any declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>, other:<root>.MyRequiresOptIn.MyLevel) returnType:kotlin.Int [fake_override,operator]
|
||||
overridden:
|
||||
public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
VALUE_PARAMETER name:other index:0 type:<root>.MyRequiresOptIn.MyLevel
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public final fun hashCode (): kotlin.Int declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
|
||||
annotations:
|
||||
IntrinsicConstEvaluation
|
||||
overridden:
|
||||
public final name: kotlin.String [val]
|
||||
FUN FAKE_OVERRIDE name:<get-name> visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.String [fake_override]
|
||||
correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final fun <get-name> (): kotlin.String declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final ordinal: kotlin.Int [val]
|
||||
FUN FAKE_OVERRIDE name:<get-ordinal> visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Int [fake_override]
|
||||
correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final fun <get-ordinal> (): kotlin.Int declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:@[FlexibleNullability] java.lang.Class<@[FlexibleNullability] <root>.MyRequiresOptIn.MyLevel?>? [fake_override]
|
||||
overridden:
|
||||
public final fun getDeclaringClass (): @[FlexibleNullability] java.lang.Class<@[FlexibleNullability] E of kotlin.Enum?>? declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Unit [fake_override]
|
||||
overridden:
|
||||
protected/*protected and package*/ final fun finalize (): kotlin.Unit declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.Annotation
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Annotation
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String [fake_override] declared in kotlin.Annotation
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="OK"
|
||||
@@ -0,0 +1,43 @@
|
||||
FILE: selfReferentialAnnotation.kt
|
||||
public final annotation class Ann : R|kotlin/Annotation| {
|
||||
public constructor(@R|Ann|(e = Int(1)) e: R|kotlin/Int|): R|Ann| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val e: R|kotlin/Int| = R|<local>/e|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
@R|MyRequiresOptIn|(a = String(), b = Q|MyRequiresOptIn.MyLevel|.R|/MyRequiresOptIn.MyLevel.ERROR|) public final annotation class MyRequiresOptIn : R|kotlin/Annotation| {
|
||||
public constructor(a: R|kotlin/String| = String(), @R|MyRequiresOptIn|(a = String(), b = Q|MyRequiresOptIn.MyLevel|.R|/MyRequiresOptIn.MyLevel.WARNING|) b: R|MyRequiresOptIn.MyLevel| = Q|MyRequiresOptIn.MyLevel|.R|/MyRequiresOptIn.MyLevel.ERROR|): R|MyRequiresOptIn| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val a: R|kotlin/String| = R|<local>/a|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public final val b: R|MyRequiresOptIn.MyLevel| = R|<local>/b|
|
||||
public get(): R|MyRequiresOptIn.MyLevel|
|
||||
|
||||
public final enum class MyLevel : R|kotlin/Enum<MyRequiresOptIn.MyLevel>| {
|
||||
private constructor(): R|MyRequiresOptIn.MyLevel| {
|
||||
super<R|kotlin/Enum<MyRequiresOptIn.MyLevel>|>()
|
||||
}
|
||||
|
||||
public final static enum entry WARNING: R|MyRequiresOptIn.MyLevel|
|
||||
public final static enum entry ERROR: R|MyRequiresOptIn.MyLevel|
|
||||
public final static fun values(): R|kotlin/Array<MyRequiresOptIn.MyLevel>| {
|
||||
}
|
||||
|
||||
public final static fun valueOf(value: R|kotlin/String|): R|MyRequiresOptIn.MyLevel| {
|
||||
}
|
||||
|
||||
public final static val entries: R|kotlin/enums/EnumEntries<MyRequiresOptIn.MyLevel>|
|
||||
public get(): R|kotlin/enums/EnumEntries<MyRequiresOptIn.MyLevel>|
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public final fun box(): R|kotlin/String| {
|
||||
^box String(OK)
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
FILE fqName:<root> fileName:/selfReferentialAnnotation.kt
|
||||
CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Ann
|
||||
CONSTRUCTOR visibility:public <> (e:kotlin.Int) returnType:<root>.Ann [primary]
|
||||
VALUE_PARAMETER name:e index:0 type:kotlin.Int
|
||||
annotations:
|
||||
Ann(e = '1')
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation]'
|
||||
PROPERTY name:e visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:e type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'e: kotlin.Int declared in <root>.Ann.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-e> visibility:public modality:FINAL <> ($this:<root>.Ann) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:e visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Ann
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-e> (): kotlin.Int declared in <root>.Ann'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:e type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Ann declared in <root>.Ann.<get-e>' type=<root>.Ann origin=null
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.Annotation
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Annotation
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String [fake_override] declared in kotlin.Annotation
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS ANNOTATION_CLASS name:MyRequiresOptIn modality:OPEN visibility:public superTypes:[kotlin.Annotation]
|
||||
annotations:
|
||||
MyRequiresOptIn(a = '', b = GET_ENUM 'ENUM_ENTRY name:ERROR' type=<root>.MyRequiresOptIn.MyLevel)
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyRequiresOptIn
|
||||
CONSTRUCTOR visibility:public <> (a:kotlin.String, b:<root>.MyRequiresOptIn.MyLevel) returnType:<root>.MyRequiresOptIn [primary]
|
||||
VALUE_PARAMETER name:a index:0 type:kotlin.String
|
||||
EXPRESSION_BODY
|
||||
CONST String type=kotlin.String value=""
|
||||
VALUE_PARAMETER name:b index:1 type:<root>.MyRequiresOptIn.MyLevel
|
||||
annotations:
|
||||
MyRequiresOptIn(a = '', b = GET_ENUM 'ENUM_ENTRY name:WARNING' type=<root>.MyRequiresOptIn.MyLevel)
|
||||
EXPRESSION_BODY
|
||||
GET_ENUM 'ENUM_ENTRY name:ERROR' type=<root>.MyRequiresOptIn.MyLevel
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:MyRequiresOptIn modality:OPEN visibility:public superTypes:[kotlin.Annotation]'
|
||||
PROPERTY name:a visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'a: kotlin.String declared in <root>.MyRequiresOptIn.<init>' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-a> visibility:public modality:FINAL <> ($this:<root>.MyRequiresOptIn) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.MyRequiresOptIn
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-a> (): kotlin.String declared in <root>.MyRequiresOptIn'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyRequiresOptIn declared in <root>.MyRequiresOptIn.<get-a>' type=<root>.MyRequiresOptIn origin=null
|
||||
PROPERTY name:b visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:b type:<root>.MyRequiresOptIn.MyLevel visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'b: <root>.MyRequiresOptIn.MyLevel declared in <root>.MyRequiresOptIn.<init>' type=<root>.MyRequiresOptIn.MyLevel origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-b> visibility:public modality:FINAL <> ($this:<root>.MyRequiresOptIn) returnType:<root>.MyRequiresOptIn.MyLevel
|
||||
correspondingProperty: PROPERTY name:b visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.MyRequiresOptIn
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-b> (): <root>.MyRequiresOptIn.MyLevel declared in <root>.MyRequiresOptIn'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:<root>.MyRequiresOptIn.MyLevel visibility:private [final]' type=<root>.MyRequiresOptIn.MyLevel origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyRequiresOptIn declared in <root>.MyRequiresOptIn.<get-b>' type=<root>.MyRequiresOptIn origin=null
|
||||
CLASS ENUM_CLASS name:MyLevel modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyRequiresOptIn.MyLevel
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.MyRequiresOptIn.MyLevel [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
|
||||
<E>: <root>.MyRequiresOptIn.MyLevel
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyLevel modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>]'
|
||||
ENUM_ENTRY name:WARNING
|
||||
init: EXPRESSION_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyRequiresOptIn.MyLevel'
|
||||
ENUM_ENTRY name:ERROR
|
||||
init: EXPRESSION_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyRequiresOptIn.MyLevel'
|
||||
PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
|
||||
annotations:
|
||||
IntrinsicConstEvaluation
|
||||
overridden:
|
||||
public final name: kotlin.String [val]
|
||||
FUN FAKE_OVERRIDE name:<get-name> visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>) returnType:kotlin.String [fake_override]
|
||||
correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final fun <get-name> (): kotlin.String declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>
|
||||
PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final ordinal: kotlin.Int [val]
|
||||
FUN FAKE_OVERRIDE name:<get-ordinal> visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>) returnType:kotlin.Int [fake_override]
|
||||
correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final fun <get-ordinal> (): kotlin.Int declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>
|
||||
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>) returnType:kotlin.Any [fake_override]
|
||||
overridden:
|
||||
protected final fun clone (): kotlin.Any declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>
|
||||
FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>, other:<root>.MyRequiresOptIn.MyLevel) returnType:kotlin.Int [fake_override,operator]
|
||||
overridden:
|
||||
public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>
|
||||
VALUE_PARAMETER name:other index:0 type:<root>.MyRequiresOptIn.MyLevel
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>) returnType:kotlin.Unit [fake_override]
|
||||
overridden:
|
||||
protected/*protected and package*/ final fun finalize (): kotlin.Unit declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>
|
||||
FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>) returnType:@[FlexibleNullability] java.lang.Class<@[FlexibleNullability] <root>.MyRequiresOptIn.MyLevel?>? [fake_override]
|
||||
overridden:
|
||||
public final fun getDeclaringClass (): @[FlexibleNullability] java.lang.Class<@[FlexibleNullability] E of kotlin.Enum?>? declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public final fun hashCode (): kotlin.Int declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyRequiresOptIn.MyLevel>
|
||||
FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<<root>.MyRequiresOptIn.MyLevel>
|
||||
SYNTHETIC_BODY kind=ENUM_VALUES
|
||||
FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:<root>.MyRequiresOptIn.MyLevel
|
||||
VALUE_PARAMETER name:value index:0 type:kotlin.String
|
||||
SYNTHETIC_BODY kind=ENUM_VALUEOF
|
||||
PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val]
|
||||
FUN ENUM_CLASS_SPECIAL_MEMBER name:<get-entries> visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<<root>.MyRequiresOptIn.MyLevel>
|
||||
correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val]
|
||||
SYNTHETIC_BODY kind=ENUM_ENTRIES
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.Annotation
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Annotation
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String [fake_override] declared in kotlin.Annotation
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="OK"
|
||||
@@ -0,0 +1,17 @@
|
||||
// FIR_DUMP
|
||||
// DUMP_IR
|
||||
|
||||
annotation class Ann(@Ann(1) val e: Int)
|
||||
|
||||
@MyRequiresOptIn("", MyRequiresOptIn.MyLevel.ERROR)
|
||||
public annotation class MyRequiresOptIn(
|
||||
val a: String = "",
|
||||
@MyRequiresOptIn("", MyRequiresOptIn.MyLevel.WARNING) val b: MyLevel = MyLevel.ERROR
|
||||
) {
|
||||
public enum class MyLevel {
|
||||
WARNING,
|
||||
ERROR,
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = "OK"
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
public final annotation class Ann : R|kotlin/Annotation| {
|
||||
public final val e: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public constructor(e: R|kotlin/Int|): R|test/Ann|
|
||||
|
||||
}
|
||||
|
||||
@R|test/MyRequiresOptIn|(a = String(), b = R|test/MyRequiresOptIn.MyLevel.ERROR|) public final annotation class MyRequiresOptIn : R|kotlin/Annotation| {
|
||||
public final val a: R|kotlin/String| = String()
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public final val b: R|test/MyRequiresOptIn.MyLevel| = test/MyRequiresOptIn.MyLevel.ERROR
|
||||
public get(): R|test/MyRequiresOptIn.MyLevel|
|
||||
|
||||
public constructor(a: R|kotlin/String| = STUB, b: R|test/MyRequiresOptIn.MyLevel| = STUB): R|test/MyRequiresOptIn|
|
||||
|
||||
public final enum class MyLevel : R|kotlin/Enum<test/MyRequiresOptIn.MyLevel>| {
|
||||
private constructor(): R|test/MyRequiresOptIn.MyLevel|
|
||||
|
||||
public final static enum entry WARNING: R|test/MyRequiresOptIn.MyLevel|
|
||||
public final static enum entry ERROR: R|test/MyRequiresOptIn.MyLevel|
|
||||
public final static fun values(): R|kotlin/Array<test/MyRequiresOptIn.MyLevel>| {
|
||||
}
|
||||
|
||||
public final static fun valueOf(value: R|kotlin/String|): R|test/MyRequiresOptIn.MyLevel| {
|
||||
}
|
||||
|
||||
public final static val entries: R|kotlin/enums/EnumEntries<test/MyRequiresOptIn.MyLevel>|
|
||||
public get(): R|kotlin/enums/EnumEntries<test/MyRequiresOptIn.MyLevel>|
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// NO_CHECK_SOURCE_VS_BINARY
|
||||
// MUTE_REASON: KT-58935
|
||||
|
||||
package test
|
||||
|
||||
annotation class Ann(@Ann(1) val e: Int)
|
||||
|
||||
@MyRequiresOptIn("", MyRequiresOptIn.MyLevel.ERROR)
|
||||
public annotation class MyRequiresOptIn(
|
||||
val a: String = "",
|
||||
@MyRequiresOptIn("", MyRequiresOptIn.MyLevel.WARNING) val b: MyLevel = MyLevel.ERROR
|
||||
) {
|
||||
public enum class MyLevel {
|
||||
WARNING,
|
||||
ERROR,
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package test
|
||||
|
||||
public final annotation class Ann : kotlin.Annotation {
|
||||
/*primary*/ public constructor Ann(/*0*/ e: kotlin.Int)
|
||||
public final val e: kotlin.Int
|
||||
public final fun `<get-e>`(): kotlin.Int
|
||||
}
|
||||
|
||||
@test.MyRequiresOptIn(a = "", b = MyLevel.ERROR) public final annotation class MyRequiresOptIn : kotlin.Annotation {
|
||||
/*primary*/ public constructor MyRequiresOptIn(/*0*/ a: kotlin.String = ..., /*1*/ b: test.MyRequiresOptIn.MyLevel = ...)
|
||||
public final val a: kotlin.String = ""
|
||||
public final fun `<get-a>`(): kotlin.String
|
||||
public final val b: test.MyRequiresOptIn.MyLevel = MyLevel.ERROR
|
||||
public final fun `<get-b>`(): test.MyRequiresOptIn.MyLevel
|
||||
|
||||
public final enum class MyLevel : kotlin.Enum<test.MyRequiresOptIn.MyLevel> {
|
||||
enum entry WARNING
|
||||
|
||||
enum entry ERROR
|
||||
|
||||
/*primary*/ private constructor MyLevel()
|
||||
@kotlin.internal.IntrinsicConstEvaluation public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ fun `<get-name>`(): kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun `<get-ordinal>`(): kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.MyRequiresOptIn.MyLevel): kotlin.Int
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<test.MyRequiresOptIn.MyLevel!>!
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ val entries: kotlin.enums.EnumEntries<test.MyRequiresOptIn.MyLevel>
|
||||
public final /*synthesized*/ fun `<get-entries>`(): kotlin.enums.EnumEntries<test.MyRequiresOptIn.MyLevel>
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): test.MyRequiresOptIn.MyLevel
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<test.MyRequiresOptIn.MyLevel>
|
||||
}
|
||||
}
|
||||
+6
@@ -329,6 +329,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/annotations/retentionInJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("singleAssignmentToVarargInAnnotation.kt")
|
||||
public void testSingleAssignmentToVarargInAnnotation() throws Exception {
|
||||
|
||||
+6
@@ -377,6 +377,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/annotations/retentionInJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("singleAssignmentToVarargInAnnotation.kt")
|
||||
public void testSingleAssignmentToVarargInAnnotation() throws Exception {
|
||||
|
||||
+6
@@ -377,6 +377,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
||||
runTest("compiler/testData/codegen/box/annotations/retentionInJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("singleAssignmentToVarargInAnnotation.kt")
|
||||
public void testSingleAssignmentToVarargInAnnotation() throws Exception {
|
||||
|
||||
+5
@@ -288,6 +288,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/annotations/retentionInJava.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("singleAssignmentToVarargInAnnotation.kt")
|
||||
public void testSingleAssignmentToVarargInAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/singleAssignmentToVarargInAnnotation.kt");
|
||||
|
||||
+5
@@ -1764,6 +1764,11 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/PrimitiveArrayArguments.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SelfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/SelfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SimpleAnnotation.kt")
|
||||
public void testSimpleAnnotation() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/SimpleAnnotation.kt");
|
||||
|
||||
Generated
+5
@@ -76,6 +76,11 @@ public class LoadKotlinWithTypeTableTestGenerated extends AbstractLoadKotlinWith
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/PrimitiveArrayArguments.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SelfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/SelfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SimpleAnnotation.kt")
|
||||
public void testSimpleAnnotation() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/SimpleAnnotation.kt");
|
||||
|
||||
+5
@@ -1765,6 +1765,11 @@ public class IrLoadJavaTestGenerated extends AbstractIrLoadJavaTest {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/PrimitiveArrayArguments.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SelfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/SelfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SimpleAnnotation.kt")
|
||||
public void testSimpleAnnotation() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/SimpleAnnotation.kt");
|
||||
|
||||
Generated
+5
@@ -1764,6 +1764,11 @@ public class LoadJavaUsingJavacTestGenerated extends AbstractLoadJavaUsingJavacT
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/PrimitiveArrayArguments.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SelfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/SelfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SimpleAnnotation.kt")
|
||||
public void testSimpleAnnotation() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/SimpleAnnotation.kt");
|
||||
|
||||
+5
@@ -78,6 +78,11 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/PrimitiveArrayArguments.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SelfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/SelfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SimpleAnnotation.kt")
|
||||
public void testSimpleAnnotation() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/SimpleAnnotation.kt");
|
||||
|
||||
+6
@@ -71,6 +71,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -71,6 +71,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -71,6 +71,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -71,6 +71,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
||||
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -82,6 +82,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
||||
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -88,6 +88,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
||||
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -80,6 +80,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -83,6 +83,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
||||
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
Generated
+5
@@ -73,6 +73,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("selfReferentialAnnotation.kt")
|
||||
public void testSelfReferentialAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user