mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
References to protected members from crossinline lambdas in the same package do not need accessors.
18 lines
294 B
Kotlin
Vendored
18 lines
294 B
Kotlin
Vendored
package a
|
|
|
|
open class A {
|
|
protected fun protectedFun(): String = "OK"
|
|
}
|
|
|
|
inline fun foo(crossinline bar: () -> String) = object {
|
|
fun baz() = bar()
|
|
}.baz()
|
|
|
|
class BSamePackage: A() {
|
|
fun test(): String = foo {
|
|
protectedFun()
|
|
}
|
|
}
|
|
|
|
// 0 INVOKESTATIC a/BSamePackage.access
|