mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 22:30:54 +01:00
Amending an undefined property via super member access always amends new Dynamic {}
#306
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 @HT154 on GitHub (Apr 21, 2025).
It's weird that this does not produce an error:
Adding a
trace()aroundsuper.lifespanindicates this expression has valuenew Dynamic {}.This behavior makes sense in dynamic context where the parent may not define properties the child needs to amend, eg.
But in a typed context where the full set of properties of the parent is known, attempting to access an unknown property should result in an error like this:
@bioball commented on GitHub (Apr 22, 2025):
We definitely want to improve this, but it's not as simple as "lookup on a
Typedshould fail". A module is also aTyped, and this syntax should still work: