Breaking change. Map operations revisited.

This commit is contained in:
Ilya Ryzhenkov
2014-06-09 23:27:42 +04:00
parent 4167359c08
commit ce5f7e9d61
6 changed files with 140 additions and 108 deletions
@@ -61,7 +61,7 @@ public class PseudocodeVariableDataCollector(
// Variables declared in an inner (deeper) scope can't be accessed from an outer scope.
// Thus they can be filtered out upon leaving the inner scope.
return data.filterKeys { variable ->
return data.filterKeys_tmp { variable ->
val lexicalScope = lexicalScopeVariableInfo.declaredIn[variable]
// '-1' for variables declared outside this pseudocode
val depth = lexicalScope?.depth ?: -1
@@ -19,7 +19,8 @@ package org.jetbrains.jet.utils.addToStdlib
import java.util.HashMap
import java.util.Collections
fun <K, V> Map<K, V>.filterKeys(predicate: (K)->Boolean): Map<K, V> {
deprecated("Replace with filterKeys when bootstrapped")
fun <K, V> Map<K, V>.filterKeys_tmp(predicate: (K)->Boolean): Map<K, V> {
val result = HashMap<K, V>()
for ((k, v) in this) {
if (predicate(k)) {