Correct line in error message for constant function

This commit is contained in:
Roberto Ierusalimschy
2025-05-12 11:42:45 -03:00
parent 5b1ab8efdc
commit 7dc6aae290
2 changed files with 8 additions and 1 deletions

View File

@@ -342,6 +342,13 @@ do
global foo <const>;
function foo (x) return end -- ERROR: foo is read-only
]], "assign to const variable 'foo'")
checkerr([[
global foo <const>;
function foo (x) -- ERROR: foo is read-only
return
end
]], "%:2%:") -- correct line in error message
end