[FIR2IR] Add conversion of function annotations

This commit is contained in:
Mikhail Glukhikh
2020-05-07 17:56:55 +03:00
parent ad00d28631
commit f3e2dbf360
62 changed files with 57 additions and 50 deletions
@@ -44,12 +44,22 @@ FILE fqName:<root> fileName:/annotationsWithDefaultParameterValues.kt
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
A(x = 'abc', y = '123')
BLOCK_BODY
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
A(x = 'def', y = <null>)
BLOCK_BODY
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
A(x = 'ghi', y = <null>)
BLOCK_BODY
FUN name:test4 visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
A(x = '456', y = <null>)
BLOCK_BODY
FUN name:test5 visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
A(x = <null>, y = <null>)
BLOCK_BODY
@@ -30,6 +30,10 @@ FILE fqName:<root> fileName:/annotationsWithVarargParameters.kt
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
A(xs = 'abc')
BLOCK_BODY
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
A(xs = <null>)
BLOCK_BODY
@@ -47,4 +47,6 @@ FILE fqName:<root> fileName:/classLiteralInAnnotation.kt
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
A(klass = CLASS_REFERENCE 'CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.reflect.KClass<<root>.C>)
BLOCK_BODY
@@ -37,6 +37,10 @@ FILE fqName:<root> fileName:/constExpressionsInAnnotationArguments.kt
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
A(x = CALL 'public final fun <get-ONE> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY)
BLOCK_BODY
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
A(x = CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null)
BLOCK_BODY
@@ -30,10 +30,14 @@ FILE fqName:<root> fileName:/constructorsWithAnnotations.kt
CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestClass
CONSTRUCTOR visibility:public <> () returnType:<root>.TestClass [primary]
annotations:
TestAnn(x = '1')
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any]'
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:<root>.TestClass
annotations:
TestAnn(x = '2')
VALUE_PARAMETER name:x index:0 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.TestClass'
@@ -86,4 +86,6 @@ FILE fqName:<root> fileName:/enumsInAnnotationArguments.kt
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
TestAnn(x = GET_ENUM 'ENUM_ENTRY name:A' type=<root>.En)
BLOCK_BODY
@@ -28,4 +28,6 @@ FILE fqName:<root> fileName:/functionsWithAnnotations.kt
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:testSimpleFunction visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
TestAnn(x = '42')
BLOCK_BODY
@@ -48,4 +48,8 @@ FILE fqName:<root> fileName:/multipleAnnotationsInSquareBrackets.kt
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
A1
A2
A3
BLOCK_BODY
@@ -29,17 +29,23 @@ FILE fqName:<root> fileName:/propertyAccessorsWithAnnotations.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
PROPERTY name:test1 visibility:public modality:FINAL [val]
FUN name:<get-test1> visibility:public modality:FINAL <> () returnType:kotlin.String
annotations:
TestAnn(x = 'test1.get')
correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): kotlin.String declared in <root>'
CONST String type=kotlin.String value=""
PROPERTY name:test2 visibility:public modality:FINAL [var]
FUN name:<get-test2> visibility:public modality:FINAL <> () returnType:kotlin.String
annotations:
TestAnn(x = 'test2.get')
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): kotlin.String declared in <root>'
CONST String type=kotlin.String value=""
FUN name:<set-test2> visibility:public modality:FINAL <> (value:kotlin.String) returnType:kotlin.Unit
annotations:
TestAnn(x = 'test2.set')
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var]
VALUE_PARAMETER name:value index:0 type:kotlin.String
BLOCK_BODY
@@ -86,4 +86,8 @@ FILE fqName:<root> fileName:/varargsInAnnotationArguments.kt
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit
annotations:
A1(xs = <null>)
A2(xs = <null>)
AA(xs = <null>)
BLOCK_BODY