-
-
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
Inference failure for concatenation #13665
Comments
This is highly related to #13254. The common factor of failed type inference for concatenations is that they trickle down to the wonderfully general, but inherently type unstable, cat_t function. Concatenations that are caught by special cases of hcat, vcat, or hvcat fare better with respect to type inference. |
dup of #13254. |
@JeffBezanson issue #13254 is a regression in 0.4, but this issue has already been there in 0.3, both for Base.return_types(hcat, (Int64, Array{Int64,2}))
Base.return_types(vcat, (Int64, Array{Int64,1})) both return Coming from Matlab, it's natural to write |
The reason why I'm mentioning this is that I've been working on some code that could fix this issue but not #13254 using generated functions, see https://gist.github.com/afniedermayer/947faadd362778d088d7 |
Ok. I think we should find a way to fix this without |
This issue was referenced in a recent query on julia-users (https://groups.google.com/forum/#!topic/julia-users/ovCy89NDpJ0) where it was pointed out that Now I don't fully understand the impact, but I think I was able to get a type-stable version of Workaround was essentially to widen signatures of specialised
As I don't know how to try these changes out directly, I copied method definitions and made signature changes (overwriting Base methods) and then tested with the following:
All return types seemed to be inferred correctly. |
results in
This issue looks related to, but different from #13254 since there is no
T[a:b;]
involved.See also discussion at https://groups.google.com/forum/#!topic/julia-users/_lIVpV0e_WI
The text was updated successfully, but these errors were encountered: