Eagerly check function arguments when called from inside iterable (#778)

This mitigates an issue where lazy mappings and listings widen an existing bug.

This is a follow-up to https://github.com/apple/pkl/pull/752.
This commit is contained in:
Daniel Chao
2024-11-05 09:05:09 -08:00
committed by GitHub
parent 6d161ce1d4
commit b402463f3c
22 changed files with 215 additions and 49 deletions

View File

@@ -31,3 +31,27 @@ res2 {
}.birds
}
}
res3 {
for (key, _ in Map("hello-there", 5)) {
...myself(new Listing {
new Listing {
key
}
})
}
}
res4 {
for (key, _ in Map("hello-there", 5)) {
...myself2.apply(new Listing {
new Listing {
key
}
})
}
}
function myself(l: Listing<Listing<String>>) = l
local myself2 = (l: Listing<Listing<String>>) -> l

View File

@@ -8,3 +8,13 @@ res2 {
age = 1
}
}
res3 {
new {
"hello-there"
}
}
res4 {
new {
"hello-there"
}
}