Hello! This is intentional behavior, albeit tricky to read.
Type assertion expressions can only return a single value, they always “drop” the rest of the type pack, you can see the same behavior occur if you wrap a function call in parentheses.
local Success, Response = (pcall(..., ...))
If you’re working around typing issues with pcall you could try casting the function to (...any) -> (...any) and then annotating Success and Response.
why is it like this though?
charscharschars
and no this still doesn’t work by the way, (if i’m doing it the way you wanted me to)
huh well that’s weird

Sorry, I should have been clearer:
local Success: boolean, Response: KeyFrameSequence = pcall(KeyframeSequenceProvider.GetkeyFrameSequenceAsync :: (...any) -> (...any), KeyframeSequenceProvider, AnimationId)
… why is it like this though?
Type packs are meant to mimic how “multi-return” in Luau (and Lua before it) work. Part of the semantics of multi-return is that it only “forwards” all of the values in certain positions:
- If you directly assign the result of a multi-return
local function multiret(): (string, number, boolean) --[[ ... ]] end
local str, num, bool = multiret()
- The last value in a return statement:
local function multiret(): (string, number, boolean) --[[ ... ]] end
-- This will return `({}, string, number, boolean)`
local function forward1()
return {}, multiret()
end
- The last argument to a function call:
local function multiret(): (string, number, boolean) --[[ ... ]] end
-- This will print all returns from `multiret` and the table
print({}, multiret())
In all other cases, we take the “first” element of the type pack, for example:
local function multiret(): (string, number, boolean) --[[ ... ]] end
-- This _only_ prints the first return from `multiret` and "hmmm"
print(multiret(), "hmmm")
When you write a type assertion expression that counts as one of those “all other cases.” The ways I am aware of to do a “type pack assertion expression” are all roundabout.
thank you for the in-depth explanation, i think i had the solution right in front of me the entire time though…
local Success,Response = pcall(function() return KeyframeSequenceProvider:GetKeyframeSequenceAsync(AnimationID)::KeyframeSequence end)
![]()
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

