mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Support compatibility mode for @JvmDefault
This commit is contained in:
20
compiler/testData/codegen/java8/bytecodeText/jvmDefault/compatibility/defaultArgs.kt
vendored
Normal file
20
compiler/testData/codegen/java8/bytecodeText/jvmDefault/compatibility/defaultArgs.kt
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// !API_VERSION: 1.3
|
||||
// !JVM_DEFAULT_MODE: compatibility
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
interface KInterface {
|
||||
@JvmDefault
|
||||
fun test(s: String ="OK"): String {
|
||||
return s
|
||||
}
|
||||
}
|
||||
|
||||
// 1 INVOKESTATIC KInterface.access\$test\$jd
|
||||
// 1 INVOKESTATIC KInterface.test\$default
|
||||
|
||||
// from $default
|
||||
// 1 INVOKEINTERFACE KInterface.test
|
||||
|
||||
//from $jd
|
||||
// 1 INVOKESPECIAL KInterface.test
|
||||
20
compiler/testData/codegen/java8/bytecodeText/jvmDefault/compatibility/simpleFunction.kt
vendored
Normal file
20
compiler/testData/codegen/java8/bytecodeText/jvmDefault/compatibility/simpleFunction.kt
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// !API_VERSION: 1.3
|
||||
// !JVM_DEFAULT_MODE: compatibility
|
||||
// JVM_TARGET: 1.8
|
||||
|
||||
interface KInterface {
|
||||
@JvmDefault
|
||||
fun test2(): String {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
interface KInterface2 : KInterface {
|
||||
|
||||
}
|
||||
|
||||
// 1 INVOKESTATIC KInterface2.access\$test2\$jd
|
||||
// 1 INVOKESTATIC KInterface.access\$test2\$jd
|
||||
|
||||
// 1 INVOKESPECIAL KInterface2.test2
|
||||
// 1 INVOKESPECIAL KInterface.test2
|
||||
@@ -0,0 +1,24 @@
|
||||
// !API_VERSION: 1.3
|
||||
// !JVM_DEFAULT_MODE: compatibility
|
||||
// JVM_TARGET: 1.8
|
||||
|
||||
interface KInterface {
|
||||
@JvmDefault
|
||||
fun test2(): String {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
interface KInterface2 : KInterface {
|
||||
@JvmDefault
|
||||
abstract override fun test2(): String
|
||||
}
|
||||
|
||||
// 1 INVOKESTATIC KInterface.access\$test2\$jd
|
||||
// +
|
||||
// 0 INVOKESTATIC KInterface2.access\$test2\$jd
|
||||
// =
|
||||
// 1 INVOKESTATIC
|
||||
|
||||
// 1 INVOKESPECIAL KInterface.test2
|
||||
// 0 INVOKESPECIAL KInterface2.test2
|
||||
Reference in New Issue
Block a user