You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A pkl error is reported when refering a property defined in the amanded moudule.
How to reproduce:
// foo.pklfoo_0 {
v = 0
}
foo_1 {
v = 1
}
// bar.pklamends"foo.pkl"foo_1 {
v = foo_0.v
}
Evaluate the above pkl code (bar.pkl) then report the error message below.
$ ../pkl --version
Pkl 0.27.2 (Linux 5.15.0-1057-aws, native)
$ ../pkl eval bar.pkl
–– Pkl Error ––
Cannot find property `foo_0`.
4 | v = foo_0.v
^^^^^
at bar#foo_1.v (file:///home/taichi/temp/pkl/test/bar.pkl, line 4)
Did you mean any of the following?
foo_1
The text was updated successfully, but these errors were encountered:
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:
// bar.pklamends"foo.pkl"foo_1 {
v = module.foo_0.v
}
This post from @bioball goes into more detail about a similar case with the same motivation: #865 (comment)
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.The text was updated successfully, but these errors were encountered: