A new kind of synthetic accessors for backing fields, if accessed inside lambda / object literal / local class #KT-9657 Fixed
A set of tests provided Also #KT-4867 Fixed Also #KT-8750 Fixed Slight codegen refactoring
This commit is contained in:
@@ -9,6 +9,12 @@ class A {
|
||||
fun `access$getFoo$cp`(): Int = 1
|
||||
fun `access$setFoo$cp`(d: Int) {}
|
||||
|
||||
val bar = 0
|
||||
get() = { field }()
|
||||
|
||||
//synthetic field convention accessor
|
||||
fun `access$getBar$lp`(a: A): Int = 7
|
||||
|
||||
companion object {
|
||||
private var foo = 1;
|
||||
|
||||
@@ -26,7 +32,7 @@ class A {
|
||||
fun test() {
|
||||
{
|
||||
foo = 2;
|
||||
foo
|
||||
foo + bar
|
||||
}()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user