Files
kotlin/compiler/testData/codegen/java8/box/capturedSuperCall.kt
Mikhael Bogdanov 232d1bd9ef Switch warning to error for java-default method calls within 1.6 target
#KT-15825 Fixed

(cherry picked from commit 9b29ebb)
2017-10-11 19:20:24 +03:00

30 lines
432 B
Kotlin
Vendored

// FILE: IBase.java
interface IBase {
default String bar() {
return "OK";
}
}
// FILE: Kotlin.kt
open class Base {
fun foo() = "OK"
}
@kotlin.Suppress("DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET")
class C : Base(), IBase {
val lambda1 = {
super.foo()
}
val lambda2 = {
super.bar()
}
}
fun box(): String {
if (C().lambda1() != "OK") return "fail 1"
return C().lambda2()
}