Closed hishamhm closed 2 years ago
Teal Playground URL: https://543--teal-playground-preview.netlify.app
@pdesaulniers @euclidianAce Not sure if this proposed change has any impact on tooling (any existing parsers you are using will probably continue working, but the compiler itself will produce additional syntax errors on bare function
statements (technically, the error is being produced in the type-checking stage because I use the lax
flag, but I think that has no difference in output)).
This PR changes the language so that bare
function name() ... end
doesn't work anymore: you need to say eitherlocal function name() ... end
orglobal function name() ... end
.Record functions still work the same way:
function record:field() end
andfunction record.field() end
still work.Function values still work the same way:
x = function() end
still works.Bare
function name() ... end
still works if the file extension is.lua
instead of.tl
(triggering the compiler's "lax mode").Initial feedback regarding this change was positive back in February when I brought it up in the Matrix/Gitter chat in the wake of #500, but I'd still like to get feedback before merging this significant change!
Closes #500.