[PSI2IR] Generate value arguments for context receivers in getter/setter
This commit is contained in:
committed by
TeamCityServer
parent
5e426d5c16
commit
766e6bca75
@@ -0,0 +1,22 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class EntityContext {
|
||||
var d = DoubleArray(16)
|
||||
}
|
||||
|
||||
class EDouble(val i: Int) {
|
||||
context(EntityContext)
|
||||
var value: Double
|
||||
get() = d[i]
|
||||
set(value) { d[i] = value }
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val entityContext = EntityContext()
|
||||
with(entityContext) {
|
||||
val eDouble = EDouble(0)
|
||||
eDouble.value = .2
|
||||
return if (eDouble.value == .2) "OK" else "fail"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user