[FIR] Let prefix inc/dec call getter twice for compatibility with K1
#KT-57179 Fixed
This commit is contained in:
committed by
Space Team
parent
fea344faa4
commit
45d2424ad8
@@ -1,6 +1,3 @@
|
||||
// IGNORE_BACKEND_K2: ANY
|
||||
// Behavior changed in K2, see KT-42077
|
||||
|
||||
public var inc: Int = 0
|
||||
|
||||
public var propInc: Int = 0
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
// IGNORE_BACKEND_K1: ANY
|
||||
// Behavior changed in K2, see KT-42077
|
||||
// IGNORE_BACKEND: WASM
|
||||
// SKIP_NODE_JS
|
||||
|
||||
public var inc: Int = 0
|
||||
|
||||
public var propInc: Int = 0
|
||||
get() {++inc; return field}
|
||||
set(a: Int) {
|
||||
++inc
|
||||
field = a
|
||||
}
|
||||
|
||||
public var dec: Int = 0
|
||||
|
||||
public var propDec: Int = 0
|
||||
get() { --dec; return field}
|
||||
set(a: Int) {
|
||||
--dec
|
||||
field = a
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
++propInc
|
||||
if (inc != 2) return "fail in prefix increment: ${inc} != 2"
|
||||
if (propInc != 1) return "fail in prefix increment: ${propInc} != 1"
|
||||
|
||||
--propDec
|
||||
if (dec != -2) return "fail in prefix decrement: ${dec} != -2"
|
||||
if (propDec != -1) return "fail in prefix decrement: ${propDec} != -1"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user