From 607a598f1a833a14e3de849772c54f2e0b2dc5f1 Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Wed, 10 Mar 2021 17:38:32 +0300 Subject: [PATCH] [IR] Add irText test for generic annotations --- .../runners/ir/Fir2IrTextTestGenerated.java | 6 + .../genericAnnotationClasses.fir.kt.txt | 68 ++++++ .../genericAnnotationClasses.fir.txt | 199 +++++++++++++++ .../annotations/genericAnnotationClasses.kt | 27 +++ .../genericAnnotationClasses.kt.txt | 78 ++++++ .../annotations/genericAnnotationClasses.txt | 229 ++++++++++++++++++ .../test/runners/ir/IrTextTestGenerated.java | 6 + 7 files changed, 613 insertions(+) create mode 100644 compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt create mode 100644 compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.txt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java index cdfa41d9541..12675ff63eb 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java @@ -575,6 +575,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.kt"); } + @Test + @TestMetadata("genericAnnotationClasses.kt") + public void testGenericAnnotationClasses() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt"); + } + @Test @TestMetadata("inheritingDeprecation.kt") public void testInheritingDeprecation() throws Exception { diff --git a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.kt.txt new file mode 100644 index 00000000000..d7df752b1d4 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.kt.txt @@ -0,0 +1,68 @@ +package ann + +annotation class Test1 : Annotation { + constructor(x: Int) /* primary */ + val x: Int + field = x + get + +} + +annotation class Test2 : Annotation { + constructor(x: Int = 0) /* primary */ + val x: Int + field = x + get + +} + +interface I { + +} + +annotation class Test3> : Annotation { + constructor(x: Test1>) /* primary */ + val x: Test1> + field = x + get + +} + +class C : I { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +annotation class Test4 : Annotation { + constructor(x: Test3>) /* primary */ + val x: Test3> + field = x + get + +} + +class ARG { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +@Test1(x = 42) +@Test2(x = 38) +@Test3(x = Test1>>(x = 39)) +@Test4(x = Test3>(x = Test1>>(x = 40))) +class CC { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} diff --git a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.txt b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.txt new file mode 100644 index 00000000000..15d2b00bc01 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.fir.txt @@ -0,0 +1,199 @@ +FILE fqName:ann fileName:/genericAnnotationClasses.kt + CLASS ANNOTATION_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:ann.Test1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in ann.Test1.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:ann.Test1) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:ann.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ann.Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': ann.Test1 declared in ann.Test1.' type=ann.Test1 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: 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: 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: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test2 + TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any] + TYPE_PARAMETER name:T2 index:1 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:ann.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in ann.Test2.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:ann.Test2) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:ann.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ann.Test2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': ann.Test2 declared in ann.Test2.' type=ann.Test2 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: 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: 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: type:kotlin.Any + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.I + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test3 + TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] + TYPE_PARAMETER name:T2 index:1 variance: superTypes:[ann.I] + CONSTRUCTOR visibility:public <> (x:ann.Test1>) returnType:ann.Test3 [primary] + VALUE_PARAMETER name:x index:0 type:ann.Test1> + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:ann.Test1> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: ann.Test1> declared in ann.Test3.' type=ann.Test1> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:ann.Test3) returnType:ann.Test1> + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:ann.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): ann.Test1> declared in ann.Test3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:ann.Test1> visibility:private [final]' type=ann.Test1> origin=null + receiver: GET_VAR ': ann.Test3 declared in ann.Test3.' type=ann.Test3 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: 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: 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: type:kotlin.Any + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[ann.I] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.C + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> () returnType:ann.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[ann.I]' + 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 ann.I + $this: VALUE_PARAMETER name: 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 ann.I + $this: VALUE_PARAMETER name: 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 ann.I + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test4 + CONSTRUCTOR visibility:public <> (x:ann.Test3>) returnType:ann.Test4 [primary] + VALUE_PARAMETER name:x index:0 type:ann.Test3> + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:ann.Test3> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: ann.Test3> declared in ann.Test4.' type=ann.Test3> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:ann.Test4) returnType:ann.Test3> + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:ann.Test4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): ann.Test3> declared in ann.Test4' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:ann.Test3> visibility:private [final]' type=ann.Test3> origin=null + receiver: GET_VAR ': ann.Test4 declared in ann.Test4.' type=ann.Test4 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: 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: 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: type:kotlin.Any + CLASS CLASS name:ARG modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.ARG + CONSTRUCTOR visibility:public <> () returnType:ann.ARG [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ARG modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:CC modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + Test1(x = '42') + Test2(x = '38') + Test3>(x = Test1>>(x = '39')) + Test4(x = Test3(x = Test1>>(x = '40'))) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.CC + CONSTRUCTOR visibility:public <> () returnType:ann.CC [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CC modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt new file mode 100644 index 00000000000..3e7effb8c96 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt @@ -0,0 +1,27 @@ +// IGNORE_BACKEND_FIR: JVM_IR + +package ann + +annotation class Test1(val x: Int) + +annotation class Test2(val x: Int = 0) + +interface I + +annotation class Test3>(val x: Test1>) + +class C : I + +annotation class Test4(val x: Array>>) + +class ARG + +annotation class Test5(vararg val xs: Test3>) + + +@Test1(42) +@Test2(38) +@Test3>(Test1(39)) +@Test4([Test3(Test1(40)), Test3(Test1(50)), Test3(Test1(60))]) +@Test5(*arrayOf(Test3(Test1(70))), *arrayOf(Test3(Test1(80)))) +class CC \ No newline at end of file diff --git a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt.txt b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt.txt new file mode 100644 index 00000000000..2821ce4cd91 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt.txt @@ -0,0 +1,78 @@ +package ann + +annotation class Test1 : Annotation { + constructor(x: Int) /* primary */ + val x: Int + field = x + get + +} + +annotation class Test2 : Annotation { + constructor(x: Int = 0) /* primary */ + val x: Int + field = x + get + +} + +interface I { + +} + +annotation class Test3> : Annotation { + constructor(x: Test1>) /* primary */ + val x: Test1> + field = x + get + +} + +class C : I { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +annotation class Test4 : Annotation { + constructor(x: Array>>) /* primary */ + val x: Array>> + field = x + get + +} + +class ARG { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +annotation class Test5 : Annotation { + constructor(vararg xs: Test3>) /* primary */ + val xs: Array>> + field = xs + get + +} + +@Test1(x = 42) +@Test2(x = 38) +@Test3>(x = Test1>>(x = 39)) +@Test4(x = [Test3>(x = Test1>>(x = 40)), Test3>(x = Test1>>(x = 50)), Test3>(x = Test1>>(x = 60))]) +@Test5(xs = [[Test3>(x = Test1>>(x = 70))], [Test3>(x = Test1>>(x = 80))]]) +class CC { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.txt b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.txt new file mode 100644 index 00000000000..1553eecd21f --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.txt @@ -0,0 +1,229 @@ +FILE fqName:ann fileName:/genericAnnotationClasses.kt + CLASS ANNOTATION_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:ann.Test1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in ann.Test1.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:ann.Test1) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:ann.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ann.Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': ann.Test1 declared in ann.Test1.' type=ann.Test1 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: 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: 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: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test2 + TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any] + TYPE_PARAMETER name:T2 index:1 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:ann.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in ann.Test2.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:ann.Test2) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:ann.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ann.Test2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': ann.Test2 declared in ann.Test2.' type=ann.Test2 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: 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: 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: type:kotlin.Any + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.I + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test3 + TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] + TYPE_PARAMETER name:T2 index:1 variance: superTypes:[ann.I] + CONSTRUCTOR visibility:public <> (x:ann.Test1>) returnType:ann.Test3 [primary] + VALUE_PARAMETER name:x index:0 type:ann.Test1> + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:ann.Test1> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: ann.Test1> declared in ann.Test3.' type=ann.Test1> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:ann.Test3) returnType:ann.Test1> + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:ann.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): ann.Test1> declared in ann.Test3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:ann.Test1> visibility:private [final]' type=ann.Test1> origin=null + receiver: GET_VAR ': ann.Test3 declared in ann.Test3.' type=ann.Test3 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: 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: 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: type:kotlin.Any + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[ann.I] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.C + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> () returnType:ann.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[ann.I]' + 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 ann.I + $this: VALUE_PARAMETER name: 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 ann.I + $this: VALUE_PARAMETER name: 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 ann.I + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test4 + CONSTRUCTOR visibility:public <> (x:kotlin.Array>>) returnType:ann.Test4 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Array>> + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Array>> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Array>> declared in ann.Test4.' type=kotlin.Array>> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:ann.Test4) returnType:kotlin.Array>> + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:ann.Test4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array>> declared in ann.Test4' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Array>> visibility:private [final]' type=kotlin.Array>> origin=null + receiver: GET_VAR ': ann.Test4 declared in ann.Test4.' type=ann.Test4 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: 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: 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: type:kotlin.Any + CLASS CLASS name:ARG modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.ARG + CONSTRUCTOR visibility:public <> () returnType:ann.ARG [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ARG modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Test5 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.Test5 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> (xs:kotlin.Array>>) returnType:ann.Test5 [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.Array>> varargElementType:ann.Test3> [vararg] + PROPERTY name:xs visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array>> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'xs: kotlin.Array>> [vararg] declared in ann.Test5.' type=kotlin.Array>> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:ann.Test5) returnType:kotlin.Array>> + correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:ann.Test5 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array>> declared in ann.Test5' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array>> visibility:private [final]' type=kotlin.Array>> origin=null + receiver: GET_VAR ': ann.Test5 declared in ann.Test5.' type=ann.Test5 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: 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: 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: type:kotlin.Any + CLASS CLASS name:CC modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + Test1(x = '42') + Test2(x = '38') + Test3>(x = Test1>>(x = '39')) + Test4(x = [Test3>(x = Test1>>(x = '40')), Test3>(x = Test1>>(x = '50')), Test3>(x = Test1>>(x = '60'))]) + Test5(xs = [[Test3>(x = Test1>>(x = '70'))], [Test3>(x = Test1>>(x = '80'))]]) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:ann.CC + CONSTRUCTOR visibility:public <> () returnType:ann.CC [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CC modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java index f412f8e76bb..a0f02d9f4f9 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java @@ -575,6 +575,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest { runTest("compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.kt"); } + @Test + @TestMetadata("genericAnnotationClasses.kt") + public void testGenericAnnotationClasses() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt"); + } + @Test @TestMetadata("inheritingDeprecation.kt") public void testInheritingDeprecation() throws Exception {