"field": synthetic variable creation in accessors, codegen changed accordingly, a set of tests, relevant code fix (j2k)
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
var my: String = ""
|
||||
get() = field + "K"
|
||||
set(arg) {
|
||||
field = arg
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
my = "O"
|
||||
return my
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class My {
|
||||
val my: String = "O"
|
||||
get() = field + "K"
|
||||
}
|
||||
|
||||
fun box() = My().my
|
||||
@@ -0,0 +1,13 @@
|
||||
abstract class Your {
|
||||
abstract val your: String
|
||||
|
||||
fun foo() = your
|
||||
}
|
||||
|
||||
val my: String = "O"
|
||||
get() = field + object: Your() {
|
||||
override val your = "K"
|
||||
get() = field
|
||||
}.foo()
|
||||
|
||||
fun box() = my
|
||||
@@ -0,0 +1,12 @@
|
||||
abstract class Your {
|
||||
abstract val your: String
|
||||
|
||||
fun foo() = your
|
||||
}
|
||||
|
||||
val my: String = "O"
|
||||
get() = object: Your() {
|
||||
override val your = field
|
||||
}.foo() + "K"
|
||||
|
||||
fun box() = my
|
||||
@@ -0,0 +1,4 @@
|
||||
val x: String = "OK"
|
||||
get() = field
|
||||
|
||||
fun box() = x
|
||||
Reference in New Issue
Block a user