-
-
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
Fix inference for splatting numbers. Fixes #22291 #22292
Conversation
It would be oh so nice if we could do constant propagation to the extent that |
This is the problem though, because this would generate incorrect code in that case. We can't really have inference operate on the "let's hope nobody ever writes code like this" hypothesis. |
If there's no better way to fix this, to be perfectly honest I could live with |
I guess another option would be to redefine number iterators so that the type system encodes the fact that they have length 1: start(x::Number) = Val{false}()
next(x::Number, ::Val{false}) = (x, Val{true}())
done{s}(x::Number, ::Val{s}) = s |
#18823 will also address / fix this |
Given that there is a more general fix on the way, how about I add the |
Some more possible solutions that come to my mind:
|
There is some precedent for inference using a |
57776ab
to
bef89bd
Compare
|
No description provided.