-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to typedef a proc that can accept variable amount of params #1142
Comments
It seems to work for an explicit block (sorbet.run link) but not a lambda (sorbet.run link) (However, calling the block with variable number of argument would trigger error still, so maybe it's still the same) |
Variadic procs are kinda fake-able by typedefing a (Interestingly there appears to be a hard-coded limit of 10 args for all proc sigs.) FWIW, this is kinda like what Scala does under the hood for variadic function types—their stdlib literally has |
👍 This would be terrific and allow Mocktail to specify the type of block parameters when we don't know anything about the block other than the fact that it's a block. In Mocktail's internal |
Problem
I'd like to typedef a proc that can accept variable amount of params
-> View on sorbet.run
Output
Proposed solution
Something like that should be typecheck-able. In terms of API, there are several options:
The text was updated successfully, but these errors were encountered: