Files
kotlin-fork/compiler/testData/codegen/box/collections/irrelevantImplCharSequence.kt
T
Alexander Udalov fda47c45ec IR: do not change overrides for lazy IR in FakeOverrideRebuilder
`FakeOverrideBuilder.provideFakeOverrides` recursively changes overrides
for all superclasses in the hierarchy, including lazy IR, which is a lot
of extra work.

Also it leads to some tests failing in the IR fake override builder mode
because it changes correct fake overrides of Java classes to incorrect
ones. Those tests are unmuted but it doesn't mean they are fixed -- most
likely we'll generate fake overrides via IR for lazy IR too, at which
point they'll start to fail again.
2023-09-15 12:55:33 +00:00

30 lines
567 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// FILE: J.java
public class J {
abstract static public class AImpl {
public char charAt(int index) {
return 'A';
}
public final int length() { return 56; }
}
public static class A extends AImpl implements CharSequence {
public CharSequence subSequence(int start, int end) {
return null;
}
}
}
// FILE: test.kt
class X : J.A()
fun box(): String {
val x = X()
if (x.length != 56) return "fail 1"
if (x[0] != 'A') return "fail 2"
return "OK"
}