Files
kotlin-fork/compiler/testData/codegen/box/defaultArguments/implementedByFake.kt
T
Alexey Andreev 383e273fed In LightAnalysisModeTestGenerated skip tests ignored in JVM
When a test is marked as ignored in JVM BE (i.e. IGNORE_BACKEND: JVM)
it's ignored in LightAnalysisModeTestGenerated. This means that
this tests is expected to fail. However, often tests that fail
in JVM blackbox tests, don't fail in LAMTG, therefore it's reasonable
to skip these tests in LAMTG at all.
2017-05-29 15:30:27 +03:00

40 lines
722 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM
interface I<T> {
val prop: T
fun f(x: String = "1"): String
fun g(x: String = "2"): String
fun h(x: T = prop): T
}
open class A<T> {
open fun f(x: String) = x
open fun g(x: T) = x
open fun h(x: String) = x
}
class B : A<String>(), I<String> {
override val prop
get() = "3"
}
fun box(): String {
val i: I<String> = B()
var result = i.f() + i.g() + i.h()
if (result != "123") return "fail1: $result"
val b = B()
result = b.f() + b.g() + b.h()
if (result != "123") return "fail2: $result"
val a: A<String> = B()
result = a.f("q") + a.g("w") + a.h("e")
if (result != "qwe") return "fail3: $result"
return "OK"
}