Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/regression/ea66827_dataClassWrongToString.kt
T
Jinseong Jeon b48835f3ce FIR checker: fix positions of type mismatch on overrides
To handle implicit return types, those should be reported on
declarations with return type positioning strategy, instead of
return type itself.
2021-02-03 12:07:35 +03:00

9 lines
236 B
Kotlin
Vendored

// FIR_IDENTICAL
data class A(val x: Int) {
fun toArray(): IntArray =
intArrayOf(x)
override fun <!RETURN_TYPE_MISMATCH_ON_OVERRIDE!>toString<!>() =
toArray().takeWhile { it != -1 } // .joinToString()
}