Remove @JvmDefault members from delegation

This commit is contained in:
Mikhael Bogdanov
2018-03-01 13:11:57 +01:00
parent d84a15c0f6
commit f290b325ee
13 changed files with 116 additions and 32 deletions
@@ -0,0 +1,31 @@
// !API_VERSION: 1.3
// JVM_TARGET: 1.8
// WITH_RUNTIME
interface Test {
@kotlin.annotations.JvmDefault
fun test(): String {
return "O"
}
fun delegatedTest(): String {
return "fail"
}
}
class Delegate : Test {
override fun test(): String {
return "Fail"
}
override fun delegatedTest(): String {
return "K"
}
}
class TestClass(val foo: Test) : Test by foo
fun box(): String {
val testClass = TestClass(Delegate())
return testClass.test() + testClass.delegatedTest()
}
@@ -0,0 +1,28 @@
// !API_VERSION: 1.3
// JVM_TARGET: 1.8
// WITH_RUNTIME
interface Test {
@kotlin.annotations.JvmDefault
val test: String
get() = "O"
val testDelegated: String
get() = "fail"
}
class Delegate : Test {
override val test: String
get() = "fail"
override val testDelegated: String
get() = "K"
}
class TestClass(val foo: Test) : Test by foo
fun box(): String {
val testClass = TestClass(Delegate())
return testClass.test + testClass.testDelegated
}