Fix visibility of protected classes in bytecode
Protected should be translated to public as in Java so that everything would work at runtime. The real visibility is still saved to an InnerClasses attribute #KT-8269 Fixed #KT-9246 Fixed #KT-10143 Fixed
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// FILE: Outer.kt
|
||||
|
||||
package another
|
||||
open class Outer {
|
||||
protected class Stage(val run: () -> Unit)
|
||||
protected class My(var stage: Stage? = null) {
|
||||
fun initStage(f: () -> Unit): Stage {
|
||||
stage = Stage(f)
|
||||
return stage!!
|
||||
}
|
||||
}
|
||||
protected fun my(init: My.() -> Unit): My {
|
||||
val result = My()
|
||||
result.init()
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Main.kt
|
||||
|
||||
package other
|
||||
class Derived : another.Outer() {
|
||||
init {
|
||||
my {
|
||||
initStage { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
Derived()
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user