mirror of
https://github.com/apple/pkl.git
synced 2026-03-11 02:16:00 +01:00
Type checking a mapping/listing should be lazy #137
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bioball on GitHub (Apr 6, 2024).
Currently, accessing a property of type
Mapping<TypeA, TypeB>orListing<Type>will shallow-force the whole mapping/listing. The shallow-force gets skipped if the type isunknownorAny(e.g.Listing, orListing<unknown>, orListing<Any>).This should not throw, but does currently:
This is related to #405
@harryjackson commented on GitHub (Apr 6, 2024):
This is just another example. The addition happens and we get 33 but at what point is the type checking meant to happen. Using the IntelliJ plugin I get warnings telling me I'm doing something stupid.
output
@bioball commented on GitHub (Apr 7, 2024):
@harryjackson: what you're seeing is the #405 bug, rather than this one. To fix, you should add a type annotation to your properties: