-
Notifications
You must be signed in to change notification settings - Fork 63
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
Loading this package breaks vcat(Union{}[])
#1466
Comments
Hm, yes, bad, but not unexpected (for the interested reader: JuliaLang/julia#47840 and the linked issues). I understand why we have this function, but it is problematic. Apart from the error above, the problem is that the method we add to Base promotes the use of
The correct error is:
Any ideas? @fingolfin? @lgoettgens? Also happy to discuss it in person. P.S.: Any method of the form |
That shouldn't be the case, only for |
Ah yes, I meant the UnionAll with |
I will be available on Friday after the call. |
JuliaLang/julia#49349 added dispatches to base to deal with |
There is also
Anyway I made JuliaLang/julia#51718. |
Yes, the one in Hecke also needs to be removed. |
Note that we already define a
And of course it also causes this ambiguity:
So what are we supposed to do then? To me it doesn't seem we are committing type piracy, as our own types are involved in the function signature and we are not otherwise overloading any existing Base functionality except for the reduce(::typeof(vcat), A::AbstractVector{Union{}}) =
_typed_vcat(mapreduce(eltype, promote_type, A), A)
reduce(::typeof(hcat), A::AbstractVector{Union{}}) =
_typed_hcat(mapreduce(eltype, promote_type, A), A) Indeed, experimentally:
But would this be correct / acceptable ? Perhaps @vtjnash has a comment on that? |
@thofma and I decided to only fix the type piracy for |
Keno said on slack that it is fine, which means it is fine for me too. If you are quick, you can read it at https://julialang.slack.com/archives/C67TK21LJ/p1697571176343309?thread_ts=1697567034.280449&cid=C67TK21LJ |
In an empty Julia REPL:
vcat(Union{}[])
Should return
Union{}[]
, however in the current release of AbstractAlgebra, it raises a BoundsError:The text was updated successfully, but these errors were encountered: