Fix for KT-3335: Creating imported super class' inner class fails in codegen
#KT-3335 Fixed
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
open class A(val value: String) {
|
||||
inner class B(val s: String) {
|
||||
val result = value + "_" + s
|
||||
}
|
||||
}
|
||||
|
||||
class C : A("fromC") {
|
||||
fun classReceiver() = B("OK")
|
||||
fun superReceiver() = super.B("OK")
|
||||
|
||||
fun newAReceiver() = A("fromA").B("OK")
|
||||
fun aReceiver(): B {
|
||||
val a = A("fromA")
|
||||
return a.B("OK")
|
||||
}
|
||||
|
||||
fun A.extReceiver() = this.B("OK")
|
||||
fun extReceiver() = A("fromA").extReceiver()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val receiver = C()
|
||||
var result = receiver.classReceiver().result
|
||||
if (result != "fromC_OK") return "fail 1: $result"
|
||||
|
||||
result = receiver.superReceiver().result
|
||||
if (result != "fromC_OK") return "fail 2: $result"
|
||||
|
||||
|
||||
result = receiver.aReceiver().result
|
||||
if (result != "fromA_OK") return "fail 3: $result"
|
||||
|
||||
result = receiver.newAReceiver().result
|
||||
if (result != "fromA_OK") return "fail 3: $result"
|
||||
|
||||
result = receiver.extReceiver().result
|
||||
if (result != "fromA_OK") return "fail 3: $result"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user