teal-language / tl

The compiler for Teal, a typed dialect of Lua
MIT License
2.11k stars 109 forks source link

`global` keyword should be disallowed when defining a function as a table field #458

Closed pdesaulniers closed 2 years ago

pdesaulniers commented 3 years ago

I don't think the global keyword should be allowed in this context:

local tbl = {}

-- this function is stored in a table field, not in a global variable
global function tbl.say(something: string)
  print(something)
end
hishamhm commented 2 years ago

This was fixed in 1a157e83a37fb92e2941387a1d3d3710aa876239 !