mirror of
https://github.com/apple/pkl.git
synced 2026-09-13 13:21:47 +02:00
Fix for-generator variable resolution in nested eager scope (#1706)
Fixes an issue around resolving for-generator variables in some cases
This commit is contained in:
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
class Foo {
|
||||
prop: String?
|
||||
}
|
||||
|
||||
local foos: Mapping<String, Mixin<Foo>> = new Mapping<String, Mixin<Foo>> {
|
||||
for (key, value in Map("foo", Map("key", "value"))) {
|
||||
[key] = new {
|
||||
when (value.keys.contains("key")) {
|
||||
prop = value["key"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
res = foos["foo"].apply(new Foo {})
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
res {
|
||||
prop = "value"
|
||||
}
|
||||
Reference in New Issue
Block a user