teal-language / tl

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

Forward references for global types #534

Closed hishamhm closed 2 years ago

hishamhm commented 2 years ago

Should make this possible:

-- person.tl
local person = {}

global type Building

global type Person
   residence: Building
end

return person
-- building.tl
local building = {}

global type Person

global type Building
   owner: Person
end

return building
-- main.tl
local person = require("person")
local building = require("building")
local b: Building = {}
local p: Person = { residence = b }
b.owner = p
hishamhm commented 2 years ago

@darrenjennings :wave:, the netlify deploy on this PR is failing with Unauthorized — do you have any idea what's going on?