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'm wondering why variadic type packs cannot be unified with generic type packs, like in the following example:
localfunctionvariadic_identity(...: any): ...anyreturn...endlocalfunctiongeneric_call<T...>(...: T...): T...returnvariadic_identity(...)
end
where variadic_identity(...) has the type error "Failed to unify variadic packs".
Why does this happen? Is this a subtyping related limitation of the unification process? Can this could be worked on without introducing backwards incompatibilities?
Forgive me if this has been asked or answered before; from my searches I haven't seen much related to the topic.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm wondering why variadic type packs cannot be unified with generic type packs, like in the following example:
where
variadic_identity(...)
has the type error "Failed to unify variadic packs".Why does this happen? Is this a subtyping related limitation of the unification process? Can this could be worked on without introducing backwards incompatibilities?
Forgive me if this has been asked or answered before; from my searches I haven't seen much related to the topic.
Beta Was this translation helpful? Give feedback.
All reactions