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
$ echo ';;;;;;\na.b' >ex.hy
$ hy ex.hy
Traceback (most recent call last):
…
File "/tmp/ex.hy", line 1, in <module>
;;;;;;
NameError: name 'a' is not defined
The error is wrongly attributed to line 1 because the reader fails to set position information for a model created during the expansion of a.b into (. a b). Contrast with this case, which is correct:
$ echo ';;;;;;\n(. a b)' >ex.hy
$ hy ex.hy
Traceback (most recent call last):
…
File "/tmp/ex.hy", line 2, in <module>
(. a b)
NameError: name 'a' is not defined
I believe it suffices to call model.replace(model) in HyReader.fill_pos, so that positions are fixed recursively. I just need to write a test.
This bug is more consequential than it sounds because it can crash pytest internally, when non-existent columns of the source are retrieved for a traceback. Hy's own error reporting doesn't fail so badly in such a case.
The text was updated successfully, but these errors were encountered:
The error is wrongly attributed to line 1 because the reader fails to set position information for a model created during the expansion of
a.b
into(. a b)
. Contrast with this case, which is correct:I believe it suffices to call
model.replace(model)
inHyReader.fill_pos
, so that positions are fixed recursively. I just need to write a test.This bug is more consequential than it sounds because it can crash pytest internally, when non-existent columns of the source are retrieved for a traceback. Hy's own error reporting doesn't fail so badly in such a case.
The text was updated successfully, but these errors were encountered: