Generate IR for annotation class constructors.

This commit is contained in:
Pavel Kunyavskiy
2021-09-14 19:09:12 +03:00
committed by Space
parent 773c82ae48
commit a40022efcd
100 changed files with 743 additions and 244 deletions
@@ -1,32 +1,51 @@
annotation class Test1 : Annotation {
constructor(x: Int) /* primary */
open annotation class Test1 : Annotation {
constructor(x: Int) /* primary */ {
super/*Any*/()
/* <init>() */
}
val x: Int
field = x
get
}
annotation class Test2 : Annotation {
constructor(x: Int = 0) /* primary */
open annotation class Test2 : Annotation {
constructor(x: Int = 0) /* primary */ {
super/*Any*/()
/* <init>() */
}
val x: Int
field = x
get
}
annotation class Test3 : Annotation {
constructor(x: Test1) /* primary */
open annotation class Test3 : Annotation {
constructor(x: Test1) /* primary */ {
super/*Any*/()
/* <init>() */
}
val x: Test1
field = x
get
}
annotation class Test4 : Annotation {
constructor(vararg xs: Int) /* primary */
open annotation class Test4 : Annotation {
constructor(vararg xs: Int) /* primary */ {
super/*Any*/()
/* <init>() */
}
val xs: IntArray
field = xs
get
}
+16 -4
View File
@@ -1,8 +1,11 @@
FILE fqName:<root> fileName:/annotationClasses.kt
CLASS ANNOTATION_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Annotation]
CLASS ANNOTATION_CLASS name:Test1 modality:OPEN visibility:public superTypes:[kotlin.Annotation]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test1
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:<root>.Test1 [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test1 modality:OPEN visibility:public superTypes:[kotlin.Annotation]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
@@ -27,12 +30,15 @@ FILE fqName:<root> fileName:/annotationClasses.kt
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:Test2 modality:FINAL visibility:public superTypes:[kotlin.Annotation]
CLASS ANNOTATION_CLASS name:Test2 modality:OPEN visibility:public superTypes:[kotlin.Annotation]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test2
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:<root>.Test2 [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
EXPRESSION_BODY
CONST Int type=kotlin.Int value=0
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test2 modality:OPEN visibility:public superTypes:[kotlin.Annotation]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
@@ -57,10 +63,13 @@ FILE fqName:<root> fileName:/annotationClasses.kt
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:Test3 modality:FINAL visibility:public superTypes:[kotlin.Annotation]
CLASS ANNOTATION_CLASS name:Test3 modality:OPEN visibility:public superTypes:[kotlin.Annotation]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test3
CONSTRUCTOR visibility:public <> (x:<root>.Test1) returnType:<root>.Test3 [primary]
VALUE_PARAMETER name:x index:0 type:<root>.Test1
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test3 modality:OPEN visibility:public superTypes:[kotlin.Annotation]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:<root>.Test1 visibility:private [final]
EXPRESSION_BODY
@@ -85,10 +94,13 @@ FILE fqName:<root> fileName:/annotationClasses.kt
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:Test4 modality:FINAL visibility:public superTypes:[kotlin.Annotation]
CLASS ANNOTATION_CLASS name:Test4 modality:OPEN visibility:public superTypes:[kotlin.Annotation]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test4
CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:<root>.Test4 [primary]
VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test4 modality:OPEN visibility:public superTypes:[kotlin.Annotation]'
PROPERTY name:xs visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.IntArray visibility:private [final]
EXPRESSION_BODY
+6 -2
View File
@@ -20,8 +20,12 @@ object TestObject {
}
annotation class TestAnnotationClass : Annotation {
constructor() /* primary */
open annotation class TestAnnotationClass : Annotation {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
+4 -1
View File
@@ -52,9 +52,12 @@ FILE fqName:<root> fileName:/classes.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS ANNOTATION_CLASS name:TestAnnotationClass modality:FINAL visibility:public superTypes:[kotlin.Annotation]
CLASS ANNOTATION_CLASS name:TestAnnotationClass modality:OPEN visibility:public superTypes:[kotlin.Annotation]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestAnnotationClass
CONSTRUCTOR visibility:public <> () returnType:<root>.TestAnnotationClass [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnnotationClass modality:OPEN visibility:public superTypes:[kotlin.Annotation]'
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
+6 -3
View File
@@ -20,8 +20,12 @@ object TestObject {
}
annotation class TestAnnotationClass : Annotation {
constructor() /* primary */
open annotation class TestAnnotationClass : Annotation {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
@@ -37,4 +41,3 @@ enum class TestEnumClass : Enum<TestEnumClass> {
fun valueOf(value: String): TestEnumClass /* Synthetic body for ENUM_VALUEOF */
}
+4 -1
View File
@@ -52,9 +52,12 @@ FILE fqName:<root> fileName:/classes.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS ANNOTATION_CLASS name:TestAnnotationClass modality:FINAL visibility:public superTypes:[kotlin.Annotation]
CLASS ANNOTATION_CLASS name:TestAnnotationClass modality:OPEN visibility:public superTypes:[kotlin.Annotation]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestAnnotationClass
CONSTRUCTOR visibility:public <> () returnType:<root>.TestAnnotationClass [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnnotationClass modality:OPEN visibility:public superTypes:[kotlin.Annotation]'
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