Given;
type Things = {
Foo: boolean,
Bar: number
}
type function Thingtersector(ty: type)
assert(ty:is("singleton") or ty:is("union"))
if ty:is("union") then
for _, v in ty:components() do
assert(v:is("singleton"))
end
end
return types.never
end
local function create<T>(_: { T | keyof<Things> }): Thingtersector<T>
return nil :: any
end
local _hello = create({ "Foo" })
, the Type Error;
, is generated. I don't know what it's supposed to mean, but removing the use of UDTF and instead annotating the return value as just unknown or some other type removes the Type Error.