-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
vararg tuple types not working when vararg not at last place #10770
Comments
This is absolutely not supported yet. It would be very useful, but extremely difficult. The weirdness with |
By and large there is zero support for varargs anywhere except the last slot. Many of us have had times where it could have been useful, but having dug into the code that supports varargs I agree that it would represent an enormous increase in complexity. I suspect that a good number of things we do with varargs now will be done with tuples in the future. See, for example, the discussion in #10691. So I don't think it's worth going to the effort to implement this, certainly not until we see how the tuple revamp works out. |
In that case, maybe throw an error on construction? |
Yes, that's what will happen, because |
fixed by #10380 |
This does not work:
however inside
methods
a tuple like that does seem to do something, at least when aAny...
is involved:I'm not sure how it should work but probably not as above. Allowing several
...
inside a type tuple could be useful. Related: #10380, #8974The text was updated successfully, but these errors were encountered: