Originally created by @bioball on GitHub (Jan 30, 2025).
This is a regression.
This snippet:
foo: Listing(firstOneIsSandy) = new {
new Bird { name = "Bob" }
new Bird { name = "Bob" }
}
firstOneIsSandy = (it: Listing<Bird>) -> it[0].name == "Sandy"
class Bird { name: String }
Produces the following error message:
–– Pkl Error ––
Type constraint `firstOneIsSandy` violated.
Value: new Listing { ?; ? }
1 | foo: Listing(firstOneIsSandy) = new {
^^^^^^^^^^^^^^^
In Pkl 0.26, we get more details:
–– Pkl Error ––
Type constraint `firstOneIsSandy` violated.
Value: new Listing { new Bird { name = "Bob" }; new Bird { name = ? } }
1 | foo: Listing(firstOneIsSandy) = new {
^^^^^^^^^^^^^^^
Originally created by @bioball on GitHub (Jan 30, 2025).
This is a regression.
This snippet:
```pkl
foo: Listing(firstOneIsSandy) = new {
new Bird { name = "Bob" }
new Bird { name = "Bob" }
}
firstOneIsSandy = (it: Listing<Bird>) -> it[0].name == "Sandy"
class Bird { name: String }
```
Produces the following error message:
```
–– Pkl Error ––
Type constraint `firstOneIsSandy` violated.
Value: new Listing { ?; ? }
1 | foo: Listing(firstOneIsSandy) = new {
^^^^^^^^^^^^^^^
```
In Pkl 0.26, we get more details:
```
–– Pkl Error ––
Type constraint `firstOneIsSandy` violated.
Value: new Listing { new Bird { name = "Bob" }; new Bird { name = ? } }
1 | foo: Listing(firstOneIsSandy) = new {
^^^^^^^^^^^^^^^
```
adam
added the bug label 2025-12-30 01:23:03 +01:00
This has to do with the listing/mapping typecheck changes.
Removing the type annotation on the lambda parameter gives us the same error message as in Pkl 0.26.
foo: Listing(firstOneIsSandy) = new {
new Bird { name = "Bob" }
new Bird { name = "Bob" }
}
-firstOneIsSandy = (it: Listing<Bird>) -> it[0].name == "Sandy"
+firstOneIsSandy = (it) -> it[0].name == "Sandy"
class Bird { name: String }
Perhaps the correct behavior here is to execute eager typechecks when executing a constraint node.
@bioball commented on GitHub (Jan 30, 2025):
This has to do with the listing/mapping typecheck changes.
Removing the type annotation on the lambda parameter gives us the same error message as in Pkl 0.26.
```diff
foo: Listing(firstOneIsSandy) = new {
new Bird { name = "Bob" }
new Bird { name = "Bob" }
}
-firstOneIsSandy = (it: Listing<Bird>) -> it[0].name == "Sandy"
+firstOneIsSandy = (it) -> it[0].name == "Sandy"
class Bird { name: String }
```
Perhaps the correct behavior here is to execute eager typechecks when executing a constraint node.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @bioball on GitHub (Jan 30, 2025).
This is a regression.
This snippet:
Produces the following error message:
In Pkl 0.26, we get more details:
@bioball commented on GitHub (Jan 30, 2025):
This has to do with the listing/mapping typecheck changes.
Removing the type annotation on the lambda parameter gives us the same error message as in Pkl 0.26.
Perhaps the correct behavior here is to execute eager typechecks when executing a constraint node.
@bioball commented on GitHub (Feb 20, 2025):
Closed by #964
@cceneag commented on GitHub (Jun 19, 2025):
👍