You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
localfunctionlerp<T>(a: T, b: T, t: number): Tiftype(a) ~=type(b) or (type(a) ~="number" andtype(a) ~="vector") thenwarn(`Unable to cast {typeof(a)} to number or vector`)
returnaendreturna+ (b-a) *tend
Error 1:
line 2 gives the error: Type function instance union<*blocked-203614*, nil> is uninhabited
entire line was highlighted, except if and then
Error 2:
normally, line 6 should detect that generic type T should either be number, Vector3 or Vector2 (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, where pairs, ipairs or next is omitted
Error message: Cannot iterate over a table without indexer
the table:
I've found a similar issue with generics... intersections?...
localfunctionfoo<T>(bar:number&T)
assert(typeof(bar) =="number")
typeof(bar) -- TypeError: Type function instance intersect<T & number, number> is uninhabitedend
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, except
if
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 omittedError message:
Cannot iterate over a table without indexer
the table:
The text was updated successfully, but these errors were encountered: