FIR: do not generate annotations on properties from delegation

#KT-57228 Fixed
This commit is contained in:
Alexander Udalov
2023-05-17 23:56:32 +02:00
committed by Space Team
parent 40c628d431
commit 83865782ff
7 changed files with 1 additions and 19 deletions
@@ -317,7 +317,7 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I
baseSymbols.add(it)
}
basePropertySymbols[delegateProperty] = baseSymbols
annotationGenerator.generate(delegateProperty, firDelegateProperty)
// Do not generate annotations to copy K1 behavior, see KT-57228.
return delegateProperty
}
@@ -1,6 +1,3 @@
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57228 K2: annotations for interface member properties implemented by delegation are copied
annotation class Ann
interface IFoo {
@@ -1,6 +1,3 @@
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57228 K2: annotations for interface member properties implemented by delegation are copied
interface IFoo {
@Deprecated("")
val prop: String get() = ""
@@ -85,8 +85,6 @@ FILE fqName:<root> fileName:/annotationsOnDelegatedMembers.kt
receiver: GET_VAR '<this>: <root>.DFoo declared in <root>.DFoo.testExtFun' type=<root>.DFoo origin=null
$receiver: GET_VAR '<this>: kotlin.String declared in <root>.DFoo.testExtFun' type=kotlin.String origin=null
PROPERTY DELEGATED_MEMBER name:testVal visibility:public modality:OPEN [val]
annotations:
Ann
overridden:
public abstract testVal: kotlin.String [val]
FUN DELEGATED_MEMBER name:<get-testVal> visibility:public modality:OPEN <> ($this:<root>.DFoo) returnType:kotlin.String
@@ -100,8 +98,6 @@ FILE fqName:<root> fileName:/annotationsOnDelegatedMembers.kt
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:private [final]' type=<root>.IFoo origin=null
receiver: GET_VAR '<this>: <root>.DFoo declared in <root>.DFoo.<get-testVal>' type=<root>.DFoo origin=null
PROPERTY DELEGATED_MEMBER name:testExtVal visibility:public modality:OPEN [val]
annotations:
Ann
overridden:
public abstract testExtVal: kotlin.String [val]
FUN DELEGATED_MEMBER name:<get-testExtVal> visibility:public modality:OPEN <> ($this:<root>.DFoo, $receiver:kotlin.String) returnType:kotlin.String
@@ -41,13 +41,11 @@ class DFoo : IFoo {
(<this>.#$$delegate_0, <this>).testExtFun()
}
@Ann
override val testVal: String
override get(): String {
return <this>.#$$delegate_0.<get-testVal>()
}
@Ann
override val String.testExtVal: String
override get(): String {
return (<this>.#$$delegate_0, <this>).<get-testExtVal>()
@@ -41,8 +41,6 @@ FILE fqName:<root> fileName:/inheritingDeprecation.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[<root>.IFoo]'
PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val]
annotations:
Deprecated(message = '', replaceWith = <null>, level = <null>)
overridden:
public open prop: kotlin.String [val]
FUN DELEGATED_MEMBER name:<get-prop> visibility:public modality:OPEN <> ($this:<root>.Delegated) returnType:kotlin.String
@@ -56,8 +54,6 @@ FILE fqName:<root> fileName:/inheritingDeprecation.kt
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:private [final]' type=<root>.IFoo origin=null
receiver: GET_VAR '<this>: <root>.Delegated declared in <root>.Delegated.<get-prop>' type=<root>.Delegated origin=null
PROPERTY DELEGATED_MEMBER name:extProp visibility:public modality:OPEN [val]
annotations:
Deprecated(message = '', replaceWith = <null>, level = <null>)
overridden:
public open extProp: kotlin.String [val]
FUN DELEGATED_MEMBER name:<get-extProp> visibility:public modality:OPEN <> ($this:<root>.Delegated, $receiver:kotlin.String) returnType:kotlin.String
@@ -20,13 +20,11 @@ class Delegated : IFoo {
}
@Deprecated(message = "")
override val prop: String
override get(): String {
return <this>.#$$delegate_0.<get-prop>()
}
@Deprecated(message = "")
override val String.extProp: String
override get(): String {
return (<this>.#$$delegate_0, <this>).<get-extProp>()