From a27c6b77cfd3af92ea025ab6a39d1abfa8017dc5 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Tue, 17 Nov 2020 16:08:00 +0300 Subject: [PATCH] KT-43370 ACC_DEPRECATED on property accessors implemented by delegation --- .../kotlin/fir/Fir2IrTextTestGenerated.java | 5 + .../backend/jvm/codegen/irCodegenUtils.kt | 12 +- .../deprecated/inheritingDeprecation.kt | 27 +++ .../deprecated/inheritingDeprecation.txt | 81 +++++++++ .../annotations/inheritingDeprecation.fir.txt | 153 +++++++++++++++++ .../annotations/inheritingDeprecation.kt | 16 ++ .../annotations/inheritingDeprecation.txt | 156 ++++++++++++++++++ .../codegen/BytecodeListingTestGenerated.java | 5 + .../ir/IrBytecodeListingTestGenerated.java | 5 + .../kotlin/ir/IrTextTestCaseGenerated.java | 5 + 10 files changed, 464 insertions(+), 1 deletion(-) create mode 100644 compiler/testData/codegen/bytecodeListing/deprecated/inheritingDeprecation.kt create mode 100644 compiler/testData/codegen/bytecodeListing/deprecated/inheritingDeprecation.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt create mode 100644 compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.txt diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java index 6b5e0c36331..e95d5c8de5a 100644 --- a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java @@ -486,6 +486,11 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.kt"); } + @TestMetadata("inheritingDeprecation.kt") + public void testInheritingDeprecation() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt"); + } + @TestMetadata("javaAnnotation.kt") public void testJavaAnnotation() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/javaAnnotation.kt"); diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/irCodegenUtils.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/irCodegenUtils.kt index 2a7ac04af87..fcd940f528d 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/irCodegenUtils.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/irCodegenUtils.kt @@ -354,7 +354,17 @@ val IrFunction.isSyntheticMethodForProperty: Boolean val IrFunction.isDeprecatedFunction: Boolean get() = isSyntheticMethodForProperty || isDeprecatedCallable || - (this as? IrSimpleFunction)?.correspondingPropertySymbol?.owner?.isDeprecatedCallable == true + (this as? IrSimpleFunction)?.correspondingPropertySymbol?.owner?.isDeprecatedCallable == true || + isAccessorForDeprecatedPropertyImplementedByDelegation + +private val IrFunction.isAccessorForDeprecatedPropertyImplementedByDelegation: Boolean + get() = + origin == IrDeclarationOrigin.DELEGATED_MEMBER && + this is IrSimpleFunction && + correspondingPropertySymbol != null && + overriddenSymbols.any { + it.owner.correspondingPropertySymbol?.owner?.isDeprecatedCallable == true + } @OptIn(ObsoleteDescriptorBasedAPI::class) val IrDeclaration.psiElement: PsiElement? diff --git a/compiler/testData/codegen/bytecodeListing/deprecated/inheritingDeprecation.kt b/compiler/testData/codegen/bytecodeListing/deprecated/inheritingDeprecation.kt new file mode 100644 index 00000000000..6154d4ce155 --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/deprecated/inheritingDeprecation.kt @@ -0,0 +1,27 @@ +interface IFoo { + @Deprecated("") + val prop: String get() = "" + + @Deprecated("") + val String.extProp: String get() = "" +} + +interface IFoo2 : IFoo + +class Delegated(foo: IFoo) : IFoo by foo + +class Delegated2(foo2: IFoo2) : IFoo2 by foo2 + +class DefaultImpl : IFoo + +class DefaultImpl2 : IFoo2 + +class ExplicitOverride : IFoo { + override val prop: String get() = "" + override val String.extProp: String get() = "" +} + +class ExplicitOverride2 : IFoo2 { + override val prop: String get() = "" + override val String.extProp: String get() = "" +} \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeListing/deprecated/inheritingDeprecation.txt b/compiler/testData/codegen/bytecodeListing/deprecated/inheritingDeprecation.txt new file mode 100644 index 00000000000..83b30249779 --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/deprecated/inheritingDeprecation.txt @@ -0,0 +1,81 @@ +@kotlin.Metadata +public final class DefaultImpl { + // source: 'inheritingDeprecation.kt' + public method (): void + public deprecated @org.jetbrains.annotations.NotNull method getExtProp(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String + public deprecated @org.jetbrains.annotations.NotNull method getProp(): java.lang.String +} + +@kotlin.Metadata +public final class DefaultImpl2 { + // source: 'inheritingDeprecation.kt' + public method (): void + public deprecated @org.jetbrains.annotations.NotNull method getExtProp(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String + public deprecated @org.jetbrains.annotations.NotNull method getProp(): java.lang.String +} + +@kotlin.Metadata +public final class Delegated { + // source: 'inheritingDeprecation.kt' + private synthetic final field $$delegate_0: IFoo + public method (@org.jetbrains.annotations.NotNull p0: IFoo): void + public deprecated @org.jetbrains.annotations.NotNull method getExtProp(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String + public deprecated @org.jetbrains.annotations.NotNull method getProp(): java.lang.String +} + +@kotlin.Metadata +public final class Delegated2 { + // source: 'inheritingDeprecation.kt' + private synthetic final field $$delegate_0: IFoo2 + public method (@org.jetbrains.annotations.NotNull p0: IFoo2): void + public deprecated @org.jetbrains.annotations.NotNull method getExtProp(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String + public deprecated @org.jetbrains.annotations.NotNull method getProp(): java.lang.String +} + +@kotlin.Metadata +public final class ExplicitOverride { + // source: 'inheritingDeprecation.kt' + public method (): void + public @org.jetbrains.annotations.NotNull method getExtProp(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String + public @org.jetbrains.annotations.NotNull method getProp(): java.lang.String +} + +@kotlin.Metadata +public final class ExplicitOverride2 { + // source: 'inheritingDeprecation.kt' + public method (): void + public @org.jetbrains.annotations.NotNull method getExtProp(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String + public @org.jetbrains.annotations.NotNull method getProp(): java.lang.String +} + +@kotlin.Metadata +public final class IFoo$DefaultImpls { + // source: 'inheritingDeprecation.kt' + public synthetic deprecated static @kotlin.Deprecated method getExtProp$annotations(p0: java.lang.String): void + public deprecated static @org.jetbrains.annotations.NotNull method getExtProp(@org.jetbrains.annotations.NotNull p0: IFoo, @org.jetbrains.annotations.NotNull p1: java.lang.String): java.lang.String + public synthetic deprecated static @kotlin.Deprecated method getProp$annotations(): void + public deprecated static @org.jetbrains.annotations.NotNull method getProp(@org.jetbrains.annotations.NotNull p0: IFoo): java.lang.String + public final inner class IFoo$DefaultImpls +} + +@kotlin.Metadata +public interface IFoo { + // source: 'inheritingDeprecation.kt' + public deprecated abstract @org.jetbrains.annotations.NotNull method getExtProp(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String + public deprecated abstract @org.jetbrains.annotations.NotNull method getProp(): java.lang.String + public final inner class IFoo$DefaultImpls +} + +@kotlin.Metadata +public final class IFoo2$DefaultImpls { + // source: 'inheritingDeprecation.kt' + public deprecated static @org.jetbrains.annotations.NotNull method getExtProp(@org.jetbrains.annotations.NotNull p0: IFoo2, @org.jetbrains.annotations.NotNull p1: java.lang.String): java.lang.String + public deprecated static @org.jetbrains.annotations.NotNull method getProp(@org.jetbrains.annotations.NotNull p0: IFoo2): java.lang.String + public final inner class IFoo2$DefaultImpls +} + +@kotlin.Metadata +public interface IFoo2 { + // source: 'inheritingDeprecation.kt' + public final inner class IFoo2$DefaultImpls +} diff --git a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.txt b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.txt new file mode 100644 index 00000000000..df51d7b9442 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.txt @@ -0,0 +1,153 @@ +FILE fqName: fileName:/inheritingDeprecation.kt + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + PROPERTY name:prop visibility:public modality:OPEN [val] + annotations: + Deprecated(message = '', replaceWith = , level = ) + FUN name: visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String + correspondingProperty: PROPERTY name:prop visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.IFoo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .IFoo' + CONST String type=kotlin.String value="" + PROPERTY name:extProp visibility:public modality:OPEN [val] + annotations: + Deprecated(message = '', replaceWith = , level = ) + FUN name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.String + correspondingProperty: PROPERTY name:extProp visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.IFoo + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .IFoo' + CONST String type=kotlin.String value="" + 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:Delegated modality:FINAL visibility:public superTypes:[.IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegated + CONSTRUCTOR visibility:public <> (foo:.IFoo) returnType:.Delegated [primary] + VALUE_PARAMETER name:foo index:0 type:.IFoo + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.IFoo]' + SET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=kotlin.Unit origin=EQ + receiver: GET_VAR ': .Delegated declared in .Delegated' type=.Delegated origin=null + value: GET_VAR 'foo: .IFoo declared in .Delegated.' type=.IFoo origin=null + PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val] + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Delegated) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.Delegated + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Delegated' + CALL 'public open fun (): kotlin.String declared in .IFoo' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .Delegated declared in .Delegated.' type=.Delegated origin=null + PROPERTY DELEGATED_MEMBER name:extProp visibility:public modality:OPEN [val] + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Delegated, $receiver:kotlin.String) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:extProp visibility:public modality:OPEN [val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.Delegated + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Delegated' + CALL 'public open fun (): kotlin.String declared in .IFoo' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .Delegated declared in .Delegated.' type=.Delegated origin=null + $receiver: GET_VAR ': kotlin.String declared in .Delegated.' type=kotlin.String origin=null + FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final] + 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:DefaultImpl modality:FINAL visibility:public superTypes:[.IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DefaultImpl + CONSTRUCTOR visibility:public <> () returnType:.DefaultImpl [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DefaultImpl modality:FINAL visibility:public superTypes:[.IFoo]' + PROPERTY FAKE_OVERRIDE name:prop visibility:public modality:OPEN [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:prop visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo + PROPERTY FAKE_OVERRIDE name:extProp visibility:public modality:OPEN [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:extProp visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo + $receiver: VALUE_PARAMETER name: type:kotlin.String + 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:ExplicitOverride modality:FINAL visibility:public superTypes:[.IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ExplicitOverride + CONSTRUCTOR visibility:public <> () returnType:.ExplicitOverride [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ExplicitOverride modality:FINAL visibility:public superTypes:[.IFoo]' + PROPERTY name:prop visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.ExplicitOverride) returnType:kotlin.String + correspondingProperty: PROPERTY name:prop visibility:public modality:FINAL [val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.ExplicitOverride + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .ExplicitOverride' + CONST String type=kotlin.String value="" + PROPERTY name:extProp visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.ExplicitOverride, $receiver:kotlin.String) returnType:kotlin.String + correspondingProperty: PROPERTY name:extProp visibility:public modality:FINAL [val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.ExplicitOverride + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .ExplicitOverride' + CONST String type=kotlin.String value="" + 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/inheritingDeprecation.kt b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt new file mode 100644 index 00000000000..f52f5112821 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt @@ -0,0 +1,16 @@ +interface IFoo { + @Deprecated("") + val prop: String get() = "" + + @Deprecated("") + val String.extProp: String get() = "" +} + +class Delegated(foo: IFoo) : IFoo by foo + +class DefaultImpl : IFoo + +class ExplicitOverride : IFoo { + override val prop: String get() = "" + override val String.extProp: String get() = "" +} \ No newline at end of file diff --git a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.txt b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.txt new file mode 100644 index 00000000000..0f87c3c0954 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.txt @@ -0,0 +1,156 @@ +FILE fqName: fileName:/inheritingDeprecation.kt + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + PROPERTY name:prop visibility:public modality:OPEN [val] + annotations: + Deprecated(message = '', replaceWith = , level = ) + FUN name: visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String + correspondingProperty: PROPERTY name:prop visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.IFoo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .IFoo' + CONST String type=kotlin.String value="" + PROPERTY name:extProp visibility:public modality:OPEN [val] + annotations: + Deprecated(message = '', replaceWith = , level = ) + FUN name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.String + correspondingProperty: PROPERTY name:extProp visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.IFoo + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .IFoo' + CONST String type=kotlin.String value="" + 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:Delegated modality:FINAL visibility:public superTypes:[.IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegated + CONSTRUCTOR visibility:public <> (foo:.IFoo) returnType:.Delegated [primary] + VALUE_PARAMETER name:foo index:0 type:.IFoo + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.IFoo]' + FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final] + EXPRESSION_BODY + GET_VAR 'foo: .IFoo declared in .Delegated.' type=.IFoo origin=null + PROPERTY DELEGATED_MEMBER name:extProp visibility:public modality:OPEN [val] + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Delegated, $receiver:kotlin.String) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:extProp visibility:public modality:OPEN [val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.Delegated + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Delegated' + CALL 'public open fun (): kotlin.String declared in .IFoo' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null + receiver: GET_VAR ': .Delegated declared in .Delegated.' type=.Delegated origin=null + $receiver: GET_VAR ': kotlin.String declared in .Delegated.' type=kotlin.String origin=null + PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val] + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Delegated) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.Delegated + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Delegated' + CALL 'public open fun (): kotlin.String declared in .IFoo' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null + receiver: GET_VAR ': .Delegated declared in .Delegated.' type=.Delegated 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 .IFoo + $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 .IFoo + $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 .IFoo + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:DefaultImpl modality:FINAL visibility:public superTypes:[.IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DefaultImpl + CONSTRUCTOR visibility:public <> () returnType:.DefaultImpl [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DefaultImpl modality:FINAL visibility:public superTypes:[.IFoo]' + PROPERTY FAKE_OVERRIDE name:extProp visibility:public modality:OPEN [fake_override,val] + annotations: + Deprecated(message = '', replaceWith = , level = ) + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:extProp visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:prop visibility:public modality:OPEN [fake_override,val] + annotations: + Deprecated(message = '', replaceWith = , level = ) + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:prop visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo + 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 .IFoo + $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 .IFoo + $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 .IFoo + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:ExplicitOverride modality:FINAL visibility:public superTypes:[.IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ExplicitOverride + CONSTRUCTOR visibility:public <> () returnType:.ExplicitOverride [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ExplicitOverride modality:FINAL visibility:public superTypes:[.IFoo]' + PROPERTY name:prop visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN <> ($this:.ExplicitOverride) returnType:kotlin.String + correspondingProperty: PROPERTY name:prop visibility:public modality:OPEN [val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.ExplicitOverride + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .ExplicitOverride' + CONST String type=kotlin.String value="" + PROPERTY name:extProp visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN <> ($this:.ExplicitOverride, $receiver:kotlin.String) returnType:kotlin.String + correspondingProperty: PROPERTY name:extProp visibility:public modality:OPEN [val] + overridden: + public open fun (): kotlin.String declared in .IFoo + $this: VALUE_PARAMETER name: type:.ExplicitOverride + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .ExplicitOverride' + CONST String type=kotlin.String value="" + 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 .IFoo + $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 .IFoo + $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 .IFoo + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java index 80b23465eb5..dbaf2b71209 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java @@ -783,6 +783,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { runTest("compiler/testData/codegen/bytecodeListing/deprecated/hidden.kt"); } + @TestMetadata("inheritingDeprecation.kt") + public void testInheritingDeprecation() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/deprecated/inheritingDeprecation.kt"); + } + @TestMetadata("inlineClassTypesInSignature.kt") public void testInlineClassTypesInSignature() throws Exception { runTest("compiler/testData/codegen/bytecodeListing/deprecated/inlineClassTypesInSignature.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java index 2c49cd00e69..d8b11c49fc1 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java @@ -753,6 +753,11 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes runTest("compiler/testData/codegen/bytecodeListing/deprecated/hidden.kt"); } + @TestMetadata("inheritingDeprecation.kt") + public void testInheritingDeprecation() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/deprecated/inheritingDeprecation.kt"); + } + @TestMetadata("inlineClassTypesInSignature.kt") public void testInlineClassTypesInSignature() throws Exception { runTest("compiler/testData/codegen/bytecodeListing/deprecated/inlineClassTypesInSignature.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java index a88717f6883..d9447820c42 100644 --- a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java @@ -485,6 +485,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase { runTest("compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.kt"); } + @TestMetadata("inheritingDeprecation.kt") + public void testInheritingDeprecation() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt"); + } + @TestMetadata("javaAnnotation.kt") public void testJavaAnnotation() throws Exception { runTest("compiler/testData/ir/irText/declarations/annotations/javaAnnotation.kt");