Use getValue method to receive value by key in map variable
This commit is contained in:
committed by
Yan Zhulanow
parent
872cb225f0
commit
6be340f079
+1
-1
@@ -10,7 +10,7 @@ import com.intellij.debugger.streams.trace.impl.handler.type.MapType
|
|||||||
* @author Vitaliy.Bibaev
|
* @author Vitaliy.Bibaev
|
||||||
*/
|
*/
|
||||||
class KotlinMapVariable(type: MapType, name: String) : MapVariableBase(type, name) {
|
class KotlinMapVariable(type: MapType, name: String) : MapVariableBase(type, name) {
|
||||||
override fun get(key: Expression): Expression = TextExpression("${toCode()}[${key.toCode()}]")
|
override fun get(key: Expression): Expression = this.call("getValue", key)
|
||||||
|
|
||||||
override fun set(key: Expression, newValue: Expression): Expression =
|
override fun set(key: Expression, newValue: Expression): Expression =
|
||||||
TextExpression("${toCode()}[${key.toCode()}] = ${newValue.toCode()}")
|
TextExpression("${toCode()}[${key.toCode()}] = ${newValue.toCode()}")
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ run {
|
|||||||
var i: kotlin.Int = 0
|
var i: kotlin.Int = 0
|
||||||
for (key in map.keys) {
|
for (key in map.keys) {
|
||||||
keys[i] = key
|
keys[i] = key
|
||||||
values[i] = map[key]
|
values[i] = map.getValue(key)
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
resultArray = kotlin.arrayOf<kotlin.Any?>(keys, values)
|
resultArray = kotlin.arrayOf<kotlin.Any?>(keys, values)
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
map[key]
|
map.getValue(key)
|
||||||
|
|||||||
Reference in New Issue
Block a user