Wrong error message when using "_ENV" fields

The string "_ENV" is erroneously identified as a variable _ENV,
so that results from a field is classified as a global.
This commit is contained in:
Roberto Ierusalimschy
2025-03-14 15:16:09 -03:00
parent c2dc6e8e94
commit 94d38560c3
3 changed files with 16 additions and 6 deletions

View File

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