luau icon indicating copy to clipboard operation
luau copied to clipboard

bad error message for incompatible function types

Open jackdotink opened this issue 7 months ago • 0 comments

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.

jackdotink avatar Jul 27 '24 04:07 jackdotink