Deprecate DefaultImpl methods in compatibility mode

This commit is contained in:
Mikhail Bogdanov
2020-06-19 12:23:05 +02:00
parent 9c0b96af71
commit 6c9c2a287d
4 changed files with 13 additions and 10 deletions
@@ -193,6 +193,9 @@ public class FunctionCodegen {
if (origin.getOriginKind() == JvmDeclarationOriginKind.SAM_DELEGATION) {
flags |= ACC_SYNTHETIC;
}
if (isCompatibilityStubInDefaultImpls(functionDescriptor, methodContext, state.getJvmDefaultMode())) {
flags |= ACC_DEPRECATED;
}
if (functionDescriptor.isExternal() && owner instanceof MultifileClassFacadeContext) {
// Native methods are only defined in facades and do not need package part implementations
@@ -712,9 +715,9 @@ public class FunctionCodegen {
@NotNull JvmDefaultMode jvmDefaultMode
) {
return OwnerKind.DEFAULT_IMPLS == context.getContextKind() &&
jvmDefaultMode.isCompatibility() &&
JvmAnnotationUtilKt.isCompiledToJvmDefault(DescriptorUtils.unwrapFakeOverrideToAnyDeclaration(functionDescriptor),
jvmDefaultMode) &&
jvmDefaultMode.isCompatibility();
jvmDefaultMode);
}
private static void generateLocalVariableTable(
@@ -19,7 +19,7 @@ public interface NoDefaultImpl2FromDefaultImpls {
@kotlin.Metadata
public final class WithDefaultImpl$DefaultImpls {
inner class WithDefaultImpl$DefaultImpls
public static method test(@org.jetbrains.annotations.NotNull p0: WithDefaultImpl): void
public deprecated static method test(@org.jetbrains.annotations.NotNull p0: WithDefaultImpl): void
}
@kotlin.Metadata
@@ -31,7 +31,7 @@ public interface WithDefaultImpl {
@kotlin.Metadata
public final class WithDefaultImplPure$DefaultImpls {
inner class WithDefaultImplPure$DefaultImpls
public static method test(@org.jetbrains.annotations.NotNull p0: WithDefaultImplPure): void
public deprecated static method test(@org.jetbrains.annotations.NotNull p0: WithDefaultImplPure): void
}
@kotlin.Metadata
@@ -11,7 +11,7 @@ public class B {
@kotlin.Metadata
public final class Base$DefaultImpls {
inner class Base$DefaultImpls
public static @org.jetbrains.annotations.Nullable method test(@org.jetbrains.annotations.NotNull p0: Base): java.lang.Integer
public deprecated static @org.jetbrains.annotations.Nullable method test(@org.jetbrains.annotations.NotNull p0: Base): java.lang.Integer
}
@kotlin.Metadata
@@ -24,7 +24,7 @@ public interface Base {
@kotlin.Metadata
public final class Derived$DefaultImpls {
inner class Derived$DefaultImpls
public static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Derived): java.lang.Integer
public deprecated static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Derived): java.lang.Integer
}
@kotlin.Metadata
@@ -37,7 +37,7 @@ public interface Derived {
@kotlin.Metadata
public final class Mixed$DefaultImpls {
inner class Mixed$DefaultImpls
public static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Mixed): java.lang.Integer
public deprecated static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Mixed): java.lang.Integer
}
@kotlin.Metadata
@@ -11,7 +11,7 @@ public class B {
@kotlin.Metadata
public final class Base$DefaultImpls {
inner class Base$DefaultImpls
public static @org.jetbrains.annotations.Nullable method test(@org.jetbrains.annotations.NotNull p0: Base): java.lang.Integer
public deprecated static @org.jetbrains.annotations.Nullable method test(@org.jetbrains.annotations.NotNull p0: Base): java.lang.Integer
}
@kotlin.Metadata
@@ -24,7 +24,7 @@ public interface Base {
@kotlin.Metadata
public final class Derived$DefaultImpls {
inner class Derived$DefaultImpls
public static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Derived): java.lang.Integer
public deprecated static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Derived): java.lang.Integer
}
@kotlin.Metadata
@@ -37,7 +37,7 @@ public interface Derived {
@kotlin.Metadata
public final class Mixed$DefaultImpls {
inner class Mixed$DefaultImpls
public static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Mixed): java.lang.Integer
public deprecated static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Mixed): java.lang.Integer
}
@kotlin.Metadata