Open aplavin opened 4 months ago
Strictly speaking, this isn't piracy, as the narrower method is defined in Base. It would be good to remove this, though, if possible
It would be great if we actually had non-ambiguous documentation about what is and what isn't type piracy so that we can be sure what is and what is not wrong, ref. https://github.com/JuliaLang/julia/issues/51669 . Currently there seems to be no consensus nor clear communication from core Julia devs regarding this "wider union" case.
StaticArrays does some piracy, at least in
similar()
: https://github.com/JuliaArrays/StaticArrays.jl/blob/07c12450d1b3481dda4b503564ae4a5cb4e27ce4/src/abstractarray.jl#L141-L146 Here,and it fits eg
Tuple{}
,Tuple{Int}
,Tuple{Int, Int}
.It's generally a good thing to avoid piracy in foundational packages. Maybe, also related to ambiguities like https://github.com/JuliaArrays/StructArrays.jl/issues/279?..