Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/property/protectedVarFromClass.kt
T
Alexander Udalov 9ab8da2ef9 Fix type of reference to protected var
#KT-12982 Fixed
2016-07-22 11:05:19 +03:00

23 lines
372 B
Kotlin
Vendored

// KT-12982 Incorrect type inference when accessing mutable protected property via reflection
import kotlin.reflect.KMutableProperty1
class Foo {
protected var x = 0
fun baz(p: KMutableProperty1<Foo, Int>) = p
fun print() = baz(Foo::x)
}
open class A {
protected fun a() {}
}
open class B : A() {
val x = C::a
val y = C()::a
}
class C : B()