Files
kotlin-fork/compiler/testData/codegen/box/fakeOverride/kt65707.kt
T
Pavel Kunyavskiy 9532172a22 [Fir2IR] Don't use FIR f/o builder when IR f/o builder is enabled
Before this commit, fir f/o builder was inconsistently
disabled in some places, while it should work only for lazy declarations

Attempt to use it for non-lazy declarations, without maintaining
invariant, that it would also be used for super classes
led to unpredictable results.

This commit introduces opt-in, and marks all related API to three types
* Propagate error to user
* Fine to use, as it's checked if ir f/o builder is enabled
* Fine to use, as it is definitely a lazy class.

Several cases of missing checks was fixed.

^KT-65707
2024-02-12 15:02:50 +00:00

19 lines
288 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// FILE: A.java
public interface A {
String f();
}
// FILE: B.kt
interface B : A
// FILE: C.java
public interface C extends B { }
// FILE: CImpl.kt
class CImpl(p: C) : C by p
// FILE: box.kt
fun g(c: C): String = c.f()
fun box(): String = g(CImpl { "OK" })