mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
26 lines
374 B
Kotlin
Vendored
26 lines
374 B
Kotlin
Vendored
// See KT-9246 IllegalAccessError when trying to access protected nested class from parent class
|
|
// FILE: a.kt
|
|
|
|
package a
|
|
|
|
abstract class A {
|
|
protected class C {
|
|
fun result() = "OK"
|
|
}
|
|
}
|
|
|
|
// FILE: b.kt
|
|
|
|
package b
|
|
|
|
import a.A
|
|
|
|
class B : A() {
|
|
protected val c = A.C()
|
|
val result: String get() = c.result()
|
|
}
|
|
|
|
fun box(): String {
|
|
return B().result
|
|
}
|