mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 08:31:28 +00:00
Fix for KT-6708: Compiler Error when extending open inner class: "java.lang.RuntimeException: Error generating primary constructor of class InnerB with kind IMPLEMENTATION" #KT-7421 Fixed #KT-6708 Fixed
14 lines
493 B
Kotlin
Vendored
14 lines
493 B
Kotlin
Vendored
// When inner class extends its outer, there are two instances of the outer present in the inner:
|
|
// the enclosing one and the one in the super call.
|
|
// Here we test that symbols are resolved to the instance created via the super call.
|
|
|
|
open class Outer(vararg val chars: Char) {
|
|
open inner class Inner(val s: String): Outer(s[0], s[1]) {
|
|
fun concat() = java.lang.String.valueOf(chars)
|
|
}
|
|
|
|
fun value() = Inner("OK").concat()
|
|
}
|
|
|
|
fun box() = Outer('F', 'a', 'i', 'l').value()
|