Open idk-i-reportbugs opened 3 weeks ago
I've found a similar issue with generics... intersections?...
local function foo<T>(bar: number & T)
assert(typeof(bar) == "number")
typeof(bar) -- TypeError: Type function instance intersect<T & number, number> is uninhabited
end
after the assertion bar
turns into intersect<T & number, number>
which causes the type error
this code raises 2 errors:
Error 1: line 2 gives the error:
Type function instance union<*blocked-203614*, nil> is uninhabited
entire line was highlighted, exceptif
andthen
Error 2: normally, line 6 should detect that generic type
T
should either benumber
,Vector3
orVector2
(because of the ifs at line 2-5) however, that doesn't happen. Instead, I get an error at line 6:Type function instance intersect<T, number> is uninhabited
Moreover, it seems like typechecking has problems with
for i, v in table do
, wherepairs
,ipairs
ornext
is omitted Error message:Cannot iterate over a table without indexer
the table: