Files
kotlin-fork/compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt
T
Mikhail Glukhikh 4b6cb3ebce 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
2015-10-26 16:37:32 +03:00

38 lines
737 B
Kotlin
Vendored

class A {
private var foo = 1;
fun `access$getFoo$p`(a: A): Int = 1
fun `access$setFoo$p`(a: A, d: Int) {}
//companion backing field accessors
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;
fun test() {
{
foo = 2;
foo
}()
}
fun `access$getFoo$p`(p: A.Companion): Int = 1
fun `access$setFoo$p`(p: A.Companion, d: Int) {}
}
fun test() {
{
foo = 2;
foo + bar
}()
}
}