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:
Dmitry Petrov
2017-12-15 16:15:52 +03:00
parent d8cd926a8c
commit 17b4d4a973
7 changed files with 77 additions and 3 deletions
@@ -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()