Differentiate accessors by FieldAccessorKind
Otherwise accessors for backing fields (as in '{ field }') clash with
accessors for properties (as in '{ prop }').
#KT-21258 Fixed Target versions 1.2.30
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
class Foo {
|
||||
private val fld: String = "O"
|
||||
get() = { field }() + "K"
|
||||
|
||||
val indirectFldGetter: () -> String = { fld }
|
||||
}
|
||||
|
||||
fun box() = Foo().indirectFldGetter()
|
||||
@@ -0,0 +1,12 @@
|
||||
class Foo {
|
||||
private val fld: String = "O"
|
||||
get() = { field }() + "K"
|
||||
|
||||
val indirectFldGetter: () -> String = { fld }
|
||||
|
||||
fun simpleFldGetter(): String {
|
||||
return fld
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = Foo().simpleFldGetter()
|
||||
Reference in New Issue
Block a user