-
Notifications
You must be signed in to change notification settings - Fork 148
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
Type inference failure on round
broadcast
#329
Comments
Hmm... an interesting one. Here's another that works: julia> g(v) = broadcast(x -> round(Int,x), v)
g (generic function with 1 method)
julia> g(v)
3-element SVector{3,Int64}:
1
2
3 The two likely causes: (1) our broadcast implementation is not pure enough, or (2) there may be some bug in the compiler. |
I think it's not exactly a bug in julia... more an unimplemented feature, perhaps. The fact that we return a I've got a partial fix for this, which as a side effect also removes all explicit uses of |
Ok, I actually have a full workaround for this (I think) in #330, pending tests passing everywhere. Perhaps the cause is something to do with the way inference constant propagates types, with the |
If have seen the function |
That's pretty weird. In this case though, even avoiding using |
On
StaticArrays.jl
master with Julia 0.6.1:Yet somehow this works fine:
Maybe an issue with base Julia, not with StaticArrays?
The text was updated successfully, but these errors were encountered: