fix bug with for generator variables in mixin (#297)

This commit is contained in:
Islon Scherer
2024-03-07 20:47:21 +01:00
committed by GitHub
parent 9defe868c0
commit 8dc258ef7d
4 changed files with 31 additions and 1 deletions

View File

@@ -38,3 +38,13 @@ function mapEnvLiteral(_env: Dynamic) = (it) -> (it) {
}
}
}
function addElements(keys: List<String>): Mixin<Mapping<String, String>> = new {
for (key in keys) {
[key] = key
}
}
res = new Mapping<String, String> {
["base"] = "alreadyThere"
} |> addElements(List("newElement"))

View File

@@ -36,3 +36,7 @@ foo {
}
}
}
res {
["base"] = "alreadyThere"
["newElement"] = "newElement"
}