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:
Alexander Udalov
2023-03-31 01:06:32 +02:00
committed by Space Team
parent ace2279631
commit 3120a35a88
210 changed files with 1267 additions and 7917 deletions
@@ -1,9 +1,8 @@
// !JVM_DEFAULT_MODE: compatibility
// !JVM_DEFAULT_MODE: all-compatibility
// JVM_TARGET: 1.8
// WITH_STDLIB
interface A {
@JvmDefault
fun foo(x: Int = 0): Int {
return x
}
@@ -19,4 +18,4 @@ interface A {
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: A$DefaultImpls, foo$default
// FLAGS: ACC_PUBLIC, ACC_SYNTHETIC, ACC_STATIC
// FLAGS: ACC_PUBLIC, ACC_SYNTHETIC, ACC_STATIC
@@ -1,13 +1,11 @@
// !JVM_DEFAULT_MODE: compatibility
// !JVM_DEFAULT_MODE: all-compatibility
// JVM_TARGET: 1.8
// WITH_STDLIB
interface Test {
@JvmDefault
val test: String
get() = "OK"
@JvmDefault
var test2: String
get() = "OK"
set(field) {}
@@ -24,4 +22,3 @@ interface Test {
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: Test, access$setTest2$jd
// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC
@@ -1,5 +1,4 @@
// !JVM_DEFAULT_MODE: compatibility
// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm
// !JVM_DEFAULT_MODE: all-compatibility
// JVM_TARGET: 1.8
// WITH_STDLIB
@@ -7,7 +6,6 @@ annotation class Property(val value: String)
interface Test {
@Property("OK")
@JvmDefault
val test: String
get() = "OK"
}
@@ -1,40 +0,0 @@
// !JVM_DEFAULT_MODE: enable
// JVM_TARGET: 1.8
// WITH_STDLIB
interface Test {
@JvmDefault
fun test(): String {
return "OK"
}
fun testAbstract(): String
fun testDefaultImpl() {
}
}
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: Test, test
// FLAGS: ACC_PUBLIC
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: Test, testAbstract
// FLAGS: ACC_PUBLIC, ACC_ABSTRACT
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: Test, testDefaultImpl
// FLAGS: ACC_PUBLIC, ACC_ABSTRACT
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: Test$DefaultImpls, test
// ABSENT: TRUE
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: Test$DefaultImpls, testAbstract
// ABSENT: TRUE
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: Test$DefaultImpls, testDefaultImpl
// FLAGS: ACC_PUBLIC, ACC_STATIC
@@ -1,18 +0,0 @@
// !JVM_DEFAULT_MODE: enable
// JVM_TARGET: 1.8
// WITH_STDLIB
interface Test {
@JvmDefault
var z: String
get() = "OK"
set(value) {}
}
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: Test, getZ
// FLAGS: ACC_PUBLIC
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: Test, setZ
// FLAGS: ACC_PUBLIC
@@ -1,20 +0,0 @@
// !JVM_DEFAULT_MODE: enable
// JVM_TARGET: 1.8
// WITH_STDLIB
interface Test {
@JvmDefault
fun foo(): String {
return "OK"
}
@JvmDefault
fun bar(x: String = "OK"): String {
return x
}
}
// TESTED_OBJECT_KIND: innerClass
// TESTED_OBJECTS: Test, DefaultImpls
// ABSENT: TRUE
@@ -1,18 +0,0 @@
// IGNORE_BACKEND_K2: JVM_IR
// TARGET_BACKEND: JVM
// !JVM_DEFAULT_MODE: enable
// JVM_TARGET: 1.8
// WITH_STDLIB
interface I {
@JvmDefault
private fun foo() = 4
fun bar() = { foo() + 5 }()
}
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: I, access$foo
// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC
@@ -1,23 +0,0 @@
// !JVM_DEFAULT_MODE: enable
// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm
// JVM_TARGET: 1.8
// WITH_STDLIB
annotation class Property(val value: String)
interface Test {
@Property("OK")
@JvmDefault
val test: String
get() = "OK"
fun stub() {}
}
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: Test, getTest$annotations
// ABSENT: TRUE
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: Test$DefaultImpls, getTest$annotations
// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC, ACC_DEPRECATED