Use getValue method to receive value by key in map variable

This commit is contained in:
Vitaliy.Bibaev
2017-11-16 16:40:17 +03:00
committed by Yan Zhulanow
parent 872cb225f0
commit 6be340f079
3 changed files with 3 additions and 3 deletions
@@ -10,7 +10,7 @@ import com.intellij.debugger.streams.trace.impl.handler.type.MapType
* @author Vitaliy.Bibaev
*/
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 =
TextExpression("${toCode()}[${key.toCode()}] = ${newValue.toCode()}")
+1 -1
View File
@@ -6,7 +6,7 @@ run {
var i: kotlin.Int = 0
for (key in map.keys) {
keys[i] = key
values[i] = map[key]
values[i] = map.getValue(key)
i++
}
resultArray = kotlin.arrayOf<kotlin.Any?>(keys, values)
+1 -1
View File
@@ -1 +1 @@
map[key]
map.getValue(key)