luau
luau copied to clipboard
bad error message for incompatible function types
export type Table = {
a: (number) -> (),
}
local function a(n: number) end
local function takes_table(t: Table) end
takes_table({ a = a }) -- TypeError: Type pack '...any' could not be converted into 'number'
This type error can be fixed by adding read a: (number) -> ()
to the type Table
, but that is non-obvious with the reported error.