luau
luau copied to clipboard
Errors from user-defined type functions are silenced when called via function argument with generics
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)