Deprecate DefaultImpl methods in compatibility mode

This commit is contained in:
Mikhail Bogdanov
2020-06-19 13:05:32 +02:00
parent 39740ce440
commit 41511898a1
21 changed files with 234 additions and 33 deletions
@@ -0,0 +1,27 @@
// !JVM_DEFAULT_MODE: all-compatibility
// JVM_TARGET: 1.8
// WITH_RUNTIME
interface Base {
fun test() {}
val prop: String
get() = "123"
fun withDefault(s: String = "123") {
}
}
interface Derived: Base {
}
interface Deprecated {
@java.lang.Deprecated
fun test() {
}
val prop: String
@java.lang.Deprecated get() = "123"
}
@@ -0,0 +1,52 @@
@kotlin.Metadata
public final class Base$DefaultImpls {
inner class Base$DefaultImpls
public deprecated static @java.lang.Deprecated @org.jetbrains.annotations.NotNull method getProp(@org.jetbrains.annotations.NotNull p0: Base): java.lang.String
public deprecated static @java.lang.Deprecated method test(@org.jetbrains.annotations.NotNull p0: Base): void
public synthetic static method withDefault$default(p0: Base, p1: java.lang.String, p2: int, p3: java.lang.Object): void
public deprecated static @java.lang.Deprecated method withDefault(@org.jetbrains.annotations.NotNull p0: Base, @org.jetbrains.annotations.NotNull p1: java.lang.String): void
}
@kotlin.Metadata
public interface Base {
inner class Base$DefaultImpls
public synthetic static method access$getProp$jd(p0: Base): java.lang.String
public synthetic static method access$test$jd(p0: Base): void
public synthetic static method access$withDefault$jd(p0: Base, p1: java.lang.String): void
public @org.jetbrains.annotations.NotNull method getProp(): java.lang.String
public method test(): void
public synthetic static method withDefault$default(p0: Base, p1: java.lang.String, p2: int, p3: java.lang.Object): void
public method withDefault(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
}
@kotlin.Metadata
public final class Deprecated$DefaultImpls {
inner class Deprecated$DefaultImpls
public deprecated static @java.lang.Deprecated @org.jetbrains.annotations.NotNull method getProp(@org.jetbrains.annotations.NotNull p0: Deprecated): java.lang.String
public deprecated static @java.lang.Deprecated method test(@org.jetbrains.annotations.NotNull p0: Deprecated): void
}
@kotlin.Metadata
public interface Deprecated {
inner class Deprecated$DefaultImpls
public synthetic static method access$getProp$jd(p0: Deprecated): java.lang.String
public synthetic static method access$test$jd(p0: Deprecated): void
public @java.lang.Deprecated @org.jetbrains.annotations.NotNull method getProp(): java.lang.String
public @java.lang.Deprecated method test(): void
}
@kotlin.Metadata
public final class Derived$DefaultImpls {
inner class Derived$DefaultImpls
public deprecated static @java.lang.Deprecated @org.jetbrains.annotations.NotNull method getProp(@org.jetbrains.annotations.NotNull p0: Derived): java.lang.String
public deprecated static @java.lang.Deprecated method test(@org.jetbrains.annotations.NotNull p0: Derived): void
public deprecated static @java.lang.Deprecated method withDefault(@org.jetbrains.annotations.NotNull p0: Derived, @org.jetbrains.annotations.NotNull p1: java.lang.String): void
}
@kotlin.Metadata
public interface Derived {
inner class Derived$DefaultImpls
public synthetic static method access$getProp$jd(p0: Derived): java.lang.String
public synthetic static method access$test$jd(p0: Derived): void
public synthetic static method access$withDefault$jd(p0: Derived, p1: java.lang.String): void
}
@@ -0,0 +1,18 @@
// !JVM_DEFAULT_MODE: all-compatibility
// JVM_TARGET: 1.8
// WITH_RUNTIME
// IGNORE_BACKEND: JVM_IR
// IR copies annotations to default impls
interface Deprecated {
@java.lang.Deprecated
fun test() {
}
val prop: String
@java.lang.Deprecated get() = "123"
@java.lang.Deprecated
fun withDefault(s: String = "123") {
}
}
@@ -0,0 +1,20 @@
@kotlin.Metadata
public final class Deprecated$DefaultImpls {
inner class Deprecated$DefaultImpls
public deprecated static @java.lang.Deprecated @org.jetbrains.annotations.NotNull method getProp(@org.jetbrains.annotations.NotNull p0: Deprecated): java.lang.String
public deprecated static @java.lang.Deprecated method test(@org.jetbrains.annotations.NotNull p0: Deprecated): void
public synthetic static method withDefault$default(p0: Deprecated, p1: java.lang.String, p2: int, p3: java.lang.Object): void
public deprecated static @java.lang.Deprecated method withDefault(@org.jetbrains.annotations.NotNull p0: Deprecated, @org.jetbrains.annotations.NotNull p1: java.lang.String): void
}
@kotlin.Metadata
public interface Deprecated {
inner class Deprecated$DefaultImpls
public synthetic static method access$getProp$jd(p0: Deprecated): java.lang.String
public synthetic static method access$test$jd(p0: Deprecated): void
public synthetic static method access$withDefault$jd(p0: Deprecated, p1: java.lang.String): void
public @java.lang.Deprecated @org.jetbrains.annotations.NotNull method getProp(): java.lang.String
public @java.lang.Deprecated method test(): void
public synthetic static method withDefault$default(p0: Deprecated, p1: java.lang.String, p2: int, p3: java.lang.Object): void
public @java.lang.Deprecated method withDefault(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
}
@@ -5,6 +5,8 @@
@JvmDefaultWithoutCompatibility
interface NoDefaultImpl {
fun test() {}
val prop: String
get() = "123"
}
interface WithDefaultImpl: NoDefaultImpl {
@@ -13,6 +15,8 @@ interface WithDefaultImpl: NoDefaultImpl {
interface WithDefaultImplPure {
fun test() {}
val prop: String
get() = "123"
}
@JvmDefaultWithoutCompatibility
@@ -7,6 +7,7 @@ public final class KotlinClass {
@kotlin.jvm.JvmDefaultWithoutCompatibility
@kotlin.Metadata
public interface NoDefaultImpl {
public @org.jetbrains.annotations.NotNull method getProp(): java.lang.String
public method test(): void
}
@@ -19,24 +20,29 @@ 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 @java.lang.Deprecated @org.jetbrains.annotations.NotNull method getProp(@org.jetbrains.annotations.NotNull p0: WithDefaultImpl): java.lang.String
public deprecated static @java.lang.Deprecated method test(@org.jetbrains.annotations.NotNull p0: WithDefaultImpl): void
}
@kotlin.Metadata
public interface WithDefaultImpl {
inner class WithDefaultImpl$DefaultImpls
public synthetic static method access$getProp$jd(p0: WithDefaultImpl): java.lang.String
public synthetic static method access$test$jd(p0: WithDefaultImpl): void
}
@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 @java.lang.Deprecated @org.jetbrains.annotations.NotNull method getProp(@org.jetbrains.annotations.NotNull p0: WithDefaultImplPure): java.lang.String
public deprecated static @java.lang.Deprecated method test(@org.jetbrains.annotations.NotNull p0: WithDefaultImplPure): void
}
@kotlin.Metadata
public interface WithDefaultImplPure {
inner class WithDefaultImplPure$DefaultImpls
public synthetic static method access$getProp$jd(p0: WithDefaultImplPure): java.lang.String
public synthetic static method access$test$jd(p0: WithDefaultImplPure): void
public @org.jetbrains.annotations.NotNull method getProp(): java.lang.String
public method test(): void
}
@@ -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 @java.lang.Deprecated @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 @java.lang.Deprecated @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 @java.lang.Deprecated @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 @java.lang.Deprecated @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 @java.lang.Deprecated @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 @java.lang.Deprecated @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Mixed): java.lang.Integer
}
@kotlin.Metadata