-
-
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
broadcast picking incorrect result type #4883
Comments
There's really no way for I didn't export |
@toivoh, but how does |
Comprehensions contain a special bit of magic. It is arguably the ugliest thing in the language. We will have a more general version of it eventually. One can also do things like |
Can't broadcast be written to exploit the comprehension magic, at least in common cases? |
Duplicate of #16164 |
As I commented in #16164, it seems that |
#16260 cleans up broadcast (gets rid of the "stash eval-ed functions in dictionaries", aka fake |
Broadcasting, map and comprehensions should all pick the same element type and succeed/fail in the same cases, except that broadcast handles more combinations of argument shapes. |
Ref. peripherally related julia-users thread https://groups.google.com/forum/#!searchin/julia-users/broadcast$20map/julia-users/IAZSOCZg1ww/TOvwOZBEAwAJ |
AFAICS, the first example works now on master.
|
Ah, that appears to be due to which |
Exactly, I'm trying to complete and organize them on #16986. |
fix #4883, result type of `broadcast` for arbitrary functions
|
(Other good test cases are |
The following code fails with an
InexactError()
:whereas
(albeit producing an array of type
Any
), whileproduces an array of
Float64
.Can we improve the type inference so that all three cases can generate
Float64
arrays? Note that this is needed for #4363 (for@vectorize_2arg
to usebroadcast
).The text was updated successfully, but these errors were encountered: