mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 22:30:54 +01:00
Cannot refer property defined in amended module #267
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 @taichi-ishitani on GitHub (Jan 26, 2025).
A pkl error is reported when refering a property defined in the amanded moudule.
How to reproduce:
Evaluate the above pkl code (
bar.pkl) then report the error message below.@HT154 commented on GitHub (Jan 26, 2025):
This is expected behavior and the intentional design of Pkl's scoping rules. In short, this is designed to prevent unintentional changes to name resolution. In this case, the correct (and unambiguous) way to do this looks like this:
This post from @bioball goes into more detail about a similar case with the same motivation: https://github.com/apple/pkl/discussions/865#discussioncomment-11640312
@taichi-ishitani commented on GitHub (Jan 27, 2025):
Hi @HT154 ,
Thank you for your reply.
I understood this is expected behaviro.