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
I do not expect calling testA(a) to produce a type error given that the type of argument arg has a generic type pack and should accept a type matching TestA<T...> with any instantiated type.
typeTestA<T...> = {
a: (T...) -> (),
b: (number, T...) -> ()
}
localfunctiontestA<T...>(arg:TestA<T...>) endlocala:TestA<string> =nil::anytestA(a) --Fails " Type pack 'number, string' could not be converted into 'T...' "
This issue also seems to persist with multiple arguments defined for property b as well.
typeTestB<T...> = {
a: (T...) -> (),
b: (number, boolean, T...) -> ()
}
localfunctiontestB<T...>(arg:TestB<T...>) endlocalb:TestB<string> =nil::anytestB(b) --Fails " Type pack 'number, boolean, string' could not be converted into 'T...' "
Working Cases
Removing the extra number parameter type for property b does not produce the type error
typeTestC<T...> = {
a: (T...) -> (),
b: (T...) -> ()
}
localfunctiontestC<T...>(arg:TestC<T...>) endlocalc:TestC<string> =nil::anytestC(c) -- No type error
Additionally, defining types for the generic type pack in the function definition also does not produce the type error
typeTestD<T...> = {
a: (T...) -> (),
b: (number, T...) -> ()
}
localfunctiontestD(arg:TestD<string>) endlocald:TestD<string> =nil::anytestD(d) -- No type error
Finally, if I remove property a it also does not produce a type error
typeTestE<T...> = {
b: (number, T...) -> ()
}
localfunctiontestE<T...>(arg:TestE<T...>) endlocale:TestE<string> =nil::anytestE(e) -- No type error
The text was updated successfully, but these errors were encountered:
I do not expect calling
testA(a)
to produce a type error given that the type of argumentarg
has a generic type pack and should accept a type matchingTestA<T...>
with any instantiated type.This issue also seems to persist with multiple arguments defined for property
b
as well.Working Cases
Removing the extra
number
parameter type for propertyb
does not produce the type errorAdditionally, defining types for the generic type pack in the function definition also does not produce the type error
Finally, if I remove property
a
it also does not produce a type errorThe text was updated successfully, but these errors were encountered: