luau icon indicating copy to clipboard operation
luau copied to clipboard

Errors from user-defined type functions are silenced when called via function argument with generics

Open nothing1649 opened this issue 9 months ago • 0 comments

As of version 0.663, an error from a user-defined type function is silenced if it is called via a function argument with a generic parameter. Calls to print work normally, reporting as a type error, but runtime errors are not propogated.

--!strict
type function err(t)
    print('this should be reported')
    error('this should also be reported')
end
local function f<T>(t:err<T>): () end
--print reported, but error silenced
f(1::never)

nothing1649 avatar Mar 03 '25 12:03 nothing1649