mirror of
https://github.com/apple/pkl.git
synced 2026-01-13 15:13:38 +01:00
Cannot find property #105
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 @philippemerle on GitHub (Mar 4, 2024).
Following file is correct.
But if this file is split into 2 files then there is an error.
File
base_template.pklFile
my_template.pklThen evaluating
my_template.pklproduces the following error:Here, pkl seems to not see the
Personclass.Do I miss something?
@stackoverflow commented on GitHub (Mar 4, 2024):
Why are you creating a
Mappinginstead of instantiating aPersondirectly?But the answer is the same as your previous issue: scoping. Try doing
.toTyped(module.Person).@philippemerle commented on GitHub (Mar 4, 2024):
Thank you for the provided solution. But this should be simpler without
module.prefix.In fact, my code is more complex as it builds objects dynamically. The provided example is just to illustrate the scoping issue.
@bioball commented on GitHub (Mar 4, 2024):
Closing this; see https://github.com/apple/pkl/issues/288#issuecomment-1977057061 for details about the decisions we made behind Pkl's scoping rules.