Bug: Bad error message with fields of string _ENV

Errors with fields of the string _ENV (e.g., ("_ENV").u + 1) report
the error as comming from a global.
This commit is contained in:
Roberto Ierusalimschy
2025-05-15 15:14:56 -03:00
parent 3fe7be956f
commit d1ee2a4deb
2 changed files with 19 additions and 6 deletions

View File

@@ -137,6 +137,10 @@ checkmessage("aaa=(1)..{}", "a table value")
-- bug in 5.4.6
checkmessage("a = {_ENV = {}}; print(a._ENV.x + 1)", "field 'x'")
-- a similar bug in 5.4.7, since 5.4.0
checkmessage("print(('_ENV').x + 1)", "field 'x'")
_G.aaa, _G.bbbb = nil
-- calls