e7e80be34a
Before this commit we considered !isOverride as a sign that function / field / accessor has no overridden symbols. However, it's false for deserialized, because isOverride is always false there. This commit fixes 68 BB tests but breaks 25 BB tests (not yet muted)
36 lines
810 B
Kotlin
Vendored
36 lines
810 B
Kotlin
Vendored
// WITH_RUNTIME
|
|
// KJS_WITH_FULL_RUNTIME
|
|
|
|
class C : CharSequence {
|
|
// Unused declarations, which are here only to confuse the backend who might lookup symbols by name
|
|
private val List<String>.length: Int
|
|
get() = size
|
|
private operator fun List<String>.get(i: Int) =
|
|
this.get(i)
|
|
|
|
override val length: Int
|
|
get() = 2
|
|
|
|
override fun get(index: Int): Char =
|
|
if (index == 0) 'O' else 'K'
|
|
|
|
override fun subSequence(startIndex: Int, endIndex: Int): CharSequence =
|
|
throw AssertionError()
|
|
}
|
|
|
|
fun box(): String {
|
|
var result = ""
|
|
val c = C()
|
|
for (i in c.indices) {
|
|
if (i == 0) {
|
|
result += c[i]
|
|
}
|
|
}
|
|
for ((i, x) in c.withIndex()) {
|
|
if (i == 1) {
|
|
result += x
|
|
}
|
|
}
|
|
return result
|
|
}
|