JvmDefault: remove most tests on @JvmDefault
The tests are removed because JvmDefault is going to be deprecated with error in KT-54746 and removed later in KT-57696. Many of the removed tests already had existing counterparts with the new modes `all` and `all-compatibility`. In this change, I've added such tests where they were missing, and removed tests which were testing behavior specific to the JvmDefault annotation, such as some diagnostics. #KT-54746
This commit is contained in:
committed by
Space Team
parent
ace2279631
commit
3120a35a88
+1
-158
@@ -1,184 +1,68 @@
|
||||
// FIR_IDENTICAL
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
// !JVM_DEFAULT_MODE: all
|
||||
// !JVM_TARGET: 1.8
|
||||
|
||||
public interface KInterface {
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun test(): String {
|
||||
return "OK";
|
||||
}
|
||||
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
val property: String
|
||||
get() = "OK"
|
||||
|
||||
|
||||
fun testNonDefault(): String {
|
||||
return "OK";
|
||||
}
|
||||
|
||||
val propertyNonDefault: String
|
||||
get() = "OK"
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
interface KotlinInterface : KInterface {
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun fooo() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterface.test()
|
||||
super@KotlinInterface.property
|
||||
|
||||
super@KotlinInterface.testNonDefault()
|
||||
super@KotlinInterface.propertyNonDefault
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
val propertyy: String
|
||||
get() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterface.test()
|
||||
super@KotlinInterface.property
|
||||
|
||||
super@KotlinInterface.testNonDefault()
|
||||
super@KotlinInterface.propertyNonDefault
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
fun foooNonDefault() {
|
||||
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
|
||||
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>property<!>
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterface.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
|
||||
super@KotlinInterface.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>property<!>
|
||||
|
||||
super@KotlinInterface.testNonDefault()
|
||||
super@KotlinInterface.propertyNonDefault
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val propertyyNonDefault: String
|
||||
get() {
|
||||
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
|
||||
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>property<!>
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterface.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
|
||||
super@KotlinInterface.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>property<!>
|
||||
|
||||
super@KotlinInterface.testNonDefault()
|
||||
super@KotlinInterface.propertyNonDefault
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
interface KotlinInterfaceIndirectInheritance : KotlinInterface {
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
fun foooo() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterfaceIndirectInheritance.test()
|
||||
super@KotlinInterfaceIndirectInheritance.property
|
||||
|
||||
super@KotlinInterfaceIndirectInheritance.testNonDefault()
|
||||
super@KotlinInterfaceIndirectInheritance.propertyNonDefault
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@<!DEPRECATION!>JvmDefault<!>
|
||||
val propertyyy: String
|
||||
get() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterfaceIndirectInheritance.test()
|
||||
super@KotlinInterfaceIndirectInheritance.property
|
||||
|
||||
super@KotlinInterfaceIndirectInheritance.testNonDefault()
|
||||
super@KotlinInterfaceIndirectInheritance.propertyNonDefault
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
fun fooooNonDefault() {
|
||||
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
|
||||
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>property<!>
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterfaceIndirectInheritance.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
|
||||
super@KotlinInterfaceIndirectInheritance.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>property<!>
|
||||
|
||||
super@KotlinInterfaceIndirectInheritance.testNonDefault()
|
||||
super@KotlinInterfaceIndirectInheritance.propertyNonDefault
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val propertyyyNonDefault: String
|
||||
get() {
|
||||
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
|
||||
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>property<!>
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterfaceIndirectInheritance.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
|
||||
super@KotlinInterfaceIndirectInheritance.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>property<!>
|
||||
|
||||
super@KotlinInterfaceIndirectInheritance.testNonDefault()
|
||||
super@KotlinInterfaceIndirectInheritance.propertyNonDefault
|
||||
}
|
||||
}
|
||||
return ""
|
||||
@@ -190,16 +74,10 @@ open class KotlinClass : KInterface {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClass.test()
|
||||
super@KotlinClass.property
|
||||
|
||||
super@KotlinClass.testNonDefault()
|
||||
super@KotlinClass.propertyNonDefault
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,16 +87,10 @@ open class KotlinClass : KInterface {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClass.test()
|
||||
super@KotlinClass.property
|
||||
|
||||
super@KotlinClass.testNonDefault()
|
||||
super@KotlinClass.propertyNonDefault
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,16 +103,10 @@ class KotlinClassIndirectInheritance : KotlinClass() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance.test()
|
||||
super@KotlinClassIndirectInheritance.property
|
||||
|
||||
super@KotlinClassIndirectInheritance.testNonDefault()
|
||||
super@KotlinClassIndirectInheritance.propertyNonDefault
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,16 +117,10 @@ class KotlinClassIndirectInheritance : KotlinClass() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance.test()
|
||||
super@KotlinClassIndirectInheritance.property
|
||||
|
||||
super@KotlinClassIndirectInheritance.testNonDefault()
|
||||
super@KotlinClassIndirectInheritance.propertyNonDefault
|
||||
}
|
||||
}
|
||||
return ""
|
||||
@@ -272,16 +132,10 @@ class KotlinClassIndirectInheritance2 : KotlinInterfaceIndirectInheritance {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance2.test()
|
||||
super@KotlinClassIndirectInheritance2.property
|
||||
|
||||
super@KotlinClassIndirectInheritance2.testNonDefault()
|
||||
super@KotlinClassIndirectInheritance2.propertyNonDefault
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -291,16 +145,10 @@ class KotlinClassIndirectInheritance2 : KotlinInterfaceIndirectInheritance {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance2.test()
|
||||
super@KotlinClassIndirectInheritance2.property
|
||||
|
||||
super@KotlinClassIndirectInheritance2.testNonDefault()
|
||||
super@KotlinClassIndirectInheritance2.propertyNonDefault
|
||||
}
|
||||
}
|
||||
return ""
|
||||
@@ -310,14 +158,9 @@ class KotlinClassIndirectInheritance2 : KotlinInterfaceIndirectInheritance {
|
||||
fun test() {
|
||||
KotlinClass().test()
|
||||
KotlinClass().property
|
||||
KotlinClass().propertyNonDefault
|
||||
KotlinClassIndirectInheritance2().test()
|
||||
KotlinClassIndirectInheritance2().testNonDefault()
|
||||
KotlinClassIndirectInheritance2().propertyyy
|
||||
KotlinClassIndirectInheritance2().propertyyyNonDefault
|
||||
|
||||
KotlinClass().test()
|
||||
KotlinClass().testNonDefault()
|
||||
KotlinClass().property
|
||||
KotlinClass().propertyNonDefault
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user