Function Annotations
local f: (number, string): boolean
-- Valid assignment
f = function(a: number, b: string): boolean
return true
endlocal function f(a: number, b: number): boolean
return a == b
end
-- Error: should return boolean not string
local function g(x: number): boolean
return "Hello"
endLast updated