diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/generic.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/generic.kt index 97f2b30d9b5..df3ea58ec10 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/generic.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/generic.kt @@ -2,7 +2,7 @@ // !JVM_DEFAULT_MODE: enable interface A { - @JvmDefault + @JvmDefault fun test(p: T) { } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/javaOverride.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/javaOverride.kt index b7204e24613..9a87a0a26a0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/javaOverride.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/javaOverride.kt @@ -13,7 +13,7 @@ public interface JavaInterface { // FILE: 1.kt interface KotlinInterface : JavaInterface { - @JvmDefault + @JvmDefault override fun test() {} override fun testForNonDefault() {} @@ -22,7 +22,7 @@ interface KotlinInterface : JavaInterface { } interface KotlinInterface2 : JavaInterface, KotlinInterface { - @JvmDefault + @JvmDefault override fun test() {} override fun testForNonDefault() {} @@ -37,7 +37,7 @@ interface KotlinInterfaceForIndirect : JavaInterface { interface KotlinInterfaceIndirectInheritance : KotlinInterfaceForIndirect { - @JvmDefault + @JvmDefault override fun test() {} override fun testForNonDefault() {} @@ -63,7 +63,7 @@ interface KotlinInterfaceX { } interface KotlinInterfaceManySuper: JavaInterface, KotlinInterfaceX { - @JvmDefault + @JvmDefault override fun test() {} override fun testForNonDefault() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/jvmDefaultInInheritance.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/jvmDefaultInInheritance.kt index e89e2deb868..3139cf76563 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/jvmDefaultInInheritance.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/jvmDefaultInInheritance.kt @@ -1,7 +1,7 @@ // !JVM_TARGET: 1.8 interface A { - @JvmDefault + @JvmDefault fun test() { } } @@ -28,7 +28,7 @@ class Bar2 : Foo(), A class Bar3 : Foo(), B open class BarWithJvmDefault : B { - @JvmDefault + @JvmDefault override fun test() { } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/jvmDefaults.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/jvmDefaults.kt index f7cb28811be..22820b64cd5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/jvmDefaults.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/jvmDefaults.kt @@ -2,12 +2,12 @@ // !JVM_TARGET: 1.8 public interface KInterface { - @JvmDefault + @JvmDefault fun test(): String { return "OK"; } - @JvmDefault + @JvmDefault val property: String get() = "OK" @@ -23,7 +23,7 @@ public interface KInterface { // FILE: 1.kt interface KotlinInterface : KInterface { - @JvmDefault + @JvmDefault fun fooo() { super.test() super.property @@ -42,7 +42,7 @@ interface KotlinInterface : KInterface { } } - @JvmDefault + @JvmDefault val propertyy: String get() { super.test() @@ -105,7 +105,7 @@ interface KotlinInterface : KInterface { } interface KotlinInterfaceIndirectInheritance : KotlinInterface { - @JvmDefault + @JvmDefault fun foooo() { super.test() super.property @@ -124,7 +124,7 @@ interface KotlinInterfaceIndirectInheritance : KotlinInterface { } } - @JvmDefault + @JvmDefault val propertyyy: String get() { super.test() diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/jvmDefaultsWithJava.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/jvmDefaultsWithJava.kt index b15d257c398..8517f8efd38 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/jvmDefaultsWithJava.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/jvmDefaultsWithJava.kt @@ -15,7 +15,7 @@ public interface JavaInterface { // FILE: 1.kt interface KotlinInterface : JavaInterface { - @JvmDefault + @JvmDefault fun fooo() { super.test() @@ -26,7 +26,7 @@ interface KotlinInterface : JavaInterface { } } - @JvmDefault + @JvmDefault val propertyy: String get() { super.test() @@ -39,14 +39,14 @@ interface KotlinInterface : JavaInterface { return "" } - @JvmDefault + @JvmDefault override fun testOverride(): String { return "OK"; } } interface KotlinInterfaceIndirectInheritance : KotlinInterface { - @JvmDefault + @JvmDefault fun foooo() { super.test() @@ -57,7 +57,7 @@ interface KotlinInterfaceIndirectInheritance : KotlinInterface { } } - @JvmDefault + @JvmDefault val propertyyy: String get() { super.test() diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/noJvmDefaultFlag.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/noJvmDefaultFlag.kt index 46fb4e1005e..70470e51d59 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/noJvmDefaultFlag.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/noJvmDefaultFlag.kt @@ -2,27 +2,27 @@ interface B { - @JvmDefault + @JvmDefault fun test() {} - @JvmDefault + @JvmDefault abstract fun test2(s: String = "") - @JvmDefault + @JvmDefault abstract fun test3() - @JvmDefault + @JvmDefault abstract val prop: String - @JvmDefault + @JvmDefault abstract val prop2: String - @JvmDefault + @JvmDefault val prop3: String get() = "" - @JvmDefault + @JvmDefault var prop4: String get() = "" set(value) {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/notInterface.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/notInterface.kt index 7378e4a6338..800433dea87 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/notInterface.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/notInterface.kt @@ -2,21 +2,21 @@ abstract class A { - @JvmDefault + @JvmDefault fun test() {} - @JvmDefault + @JvmDefault abstract fun test2(s: String = "") - @JvmDefault + @JvmDefault abstract fun test3() } object B { - @JvmDefault + @JvmDefault fun test() {} - @JvmDefault + @JvmDefault fun test2(s: String = "") {} } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/propertyAccessor.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/propertyAccessor.kt index ae9bf7ef203..247dd15cce9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/propertyAccessor.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/propertyAccessor.kt @@ -3,12 +3,12 @@ interface B { - @JvmDefault + @JvmDefault val prop1: String - @JvmDefault get() = "" + @JvmDefault get() = "" var prop2: String - @JvmDefault get() = "" - @JvmDefault set(value) {} + @JvmDefault get() = "" + @JvmDefault set(value) {} } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/simpleOverride.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/simpleOverride.kt index e6f26e0eec0..9ac34d7ac9b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/simpleOverride.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/simpleOverride.kt @@ -2,7 +2,7 @@ // !JVM_DEFAULT_MODE: enable interface A { - @JvmDefault + @JvmDefault fun test() {} } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/simplePropertyOverride.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/simplePropertyOverride.kt index 202e083d645..5232315c24e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/simplePropertyOverride.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/simplePropertyOverride.kt @@ -2,7 +2,7 @@ // !JVM_DEFAULT_MODE: enable interface A { - @JvmDefault + @JvmDefault val test: String get() = "OK" } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCall.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCall.kt index 28b7b07b3fb..32ffdc7e5ea 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCall.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCall.kt @@ -1,7 +1,7 @@ // !JVM_TARGET: 1.8 // FILE: 1.kt interface A { - @JvmDefault + @JvmDefault fun test() { } } @@ -12,7 +12,7 @@ interface B : A { } interface C : B { - @JvmDefault + @JvmDefault override fun test() { super.test() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity.kt index a4c01edb548..5d0e9f1393f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity.kt @@ -1,6 +1,6 @@ // !JVM_TARGET: 1.8 interface A { - @JvmDefault + @JvmDefault fun test() { } } @@ -16,7 +16,7 @@ interface B{ interface C : A, B { - @JvmDefault + @JvmDefault override fun test() { super.test() super.test() @@ -24,7 +24,7 @@ interface C : A, B { } interface D : B, A { - @JvmDefault + @JvmDefault override fun test() { super.test() super.test() diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity2.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity2.kt index 88da42e2aed..4a5bfe788af 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity2.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity2.kt @@ -1,6 +1,6 @@ // !JVM_TARGET: 1.8 interface A { - @JvmDefault + @JvmDefault fun test() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity3.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity3.kt index 774d347ef4b..691f8288efc 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity3.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity3.kt @@ -1,6 +1,6 @@ // !JVM_TARGET: 1.8 interface A { - @JvmDefault + @JvmDefault fun test() { } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/target6.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/target6.kt index 77391b331c3..e73f23b6fd5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/target6.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/target6.kt @@ -2,27 +2,27 @@ interface B { - @JvmDefault + @JvmDefault fun test() {} - @JvmDefault + @JvmDefault abstract fun test2(s: String = "") - @JvmDefault + @JvmDefault abstract fun test3() - @JvmDefault + @JvmDefault abstract val prop: String - @JvmDefault + @JvmDefault abstract val prop2: String - @JvmDefault + @JvmDefault val prop3: String get() = "" - @JvmDefault + @JvmDefault var prop4: String get() = "" set(value) {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/target8.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/target8.kt index cb0b02d8244..1421e03ba21 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/target8.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/target8.kt @@ -3,27 +3,27 @@ interface B { - @JvmDefault + @JvmDefault fun test() {} - @JvmDefault + @JvmDefault abstract fun test2(s: String = "") - @JvmDefault + @JvmDefault abstract fun test3() - @JvmDefault + @JvmDefault abstract val prop: String - @JvmDefault + @JvmDefault abstract val prop2: String - @JvmDefault + @JvmDefault val prop3: String get() = "" - @JvmDefault + @JvmDefault var prop4: String get() = "" set(value) {} diff --git a/libraries/stdlib/jvm/src/kotlin/jvm/JvmDefault.kt b/libraries/stdlib/jvm/src/kotlin/jvm/JvmDefault.kt index b1b8e752c14..784b4fb0995 100644 --- a/libraries/stdlib/jvm/src/kotlin/jvm/JvmDefault.kt +++ b/libraries/stdlib/jvm/src/kotlin/jvm/JvmDefault.kt @@ -30,4 +30,5 @@ import kotlin.internal.RequireKotlinVersionKind @SinceKotlin("1.2") @RequireKotlin("1.2.40", versionKind = RequireKotlinVersionKind.COMPILER_VERSION) @Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY) +@Deprecated("Switch to new -Xjvm-default options: `all` or `all-compatibility`") annotation class JvmDefault