local record Box<T> where (function(k: any): boolean return k is T end)(self.children[1])
children: {any}
end
local a: Box<integer> | Box<string> = (function(): Box<integer> return { children = { 1 } } end)()
if not a is Box<integer> then error "pluh" end
errors with pluh, even though it should be valid, this is because the code generates to
local a = (function() return { children = { 1, "two", "thrwee" } } end)(); if not (function(k) return type(k) == "table"
end)(a.children[1]) then error("pluh") end
whilst it should be math.type(k) == "integer"