Skip to content
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

Fewer reshape methods on julia v1.12 #400

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions src/FillArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,23 +272,24 @@
fillsimilar(parent, dims...)
end

reshape(parent::AbstractFill, dims::Integer...) = reshape(parent, dims)
reshape(parent::AbstractFill, dims::Union{Int,Colon}...) = reshape(parent, dims)
reshape(parent::AbstractFill, dims::Union{Integer,Colon}...) = reshape(parent, dims)
# resolve ambiguity with Base
reshape(parent::AbstractFillVector, dims::Colon) = parent

reshape(parent::AbstractFill, dims::Tuple{Vararg{Union{Integer,Colon}}}) =
fill_reshape(parent, Base._reshape_uncolon(parent, dims)...)
reshape(parent::AbstractFill, dims::Tuple{Vararg{Union{Int,Colon}}}) =
fill_reshape(parent, Base._reshape_uncolon(parent, dims)...)
reshape(parent::AbstractFill, shp::Tuple{Union{Integer,Base.OneTo}, Vararg{Union{Integer,Base.OneTo}}}) =
reshape(parent, Base.to_shape(shp))
if VERSION < v"1.12.0-DEV.1726"
# resolve ambiguity with Base
reshape(parent::AbstractFillVector, ::Colon) = parent
reshape(parent::AbstractFill, dims::Integer...) = reshape(parent, dims)
reshape(parent::AbstractFill, dims::Union{Int,Colon}...) = reshape(parent, dims)
reshape(parent::AbstractFill, dims::Union{Integer,Colon}...) = reshape(parent, dims)
reshape(parent::AbstractFill, dims::Tuple{Vararg{Union{Integer,Colon}}}) =

Check warning on line 281 in src/FillArrays.jl

View check run for this annotation

Codecov / codecov/patch

src/FillArrays.jl#L277-L281

Added lines #L277 - L281 were not covered by tests
fill_reshape(parent, Base._reshape_uncolon(parent, dims)...)
reshape(parent::AbstractFill, dims::Tuple{Vararg{Union{Int,Colon}}}) =

Check warning on line 283 in src/FillArrays.jl

View check run for this annotation

Codecov / codecov/patch

src/FillArrays.jl#L283

Added line #L283 was not covered by tests
fill_reshape(parent, Base._reshape_uncolon(parent, dims)...)
reshape(parent::AbstractFill, shp::Tuple{Union{Integer,Base.OneTo}, Vararg{Union{Integer,Base.OneTo}}}) =

Check warning on line 285 in src/FillArrays.jl

View check run for this annotation

Codecov / codecov/patch

src/FillArrays.jl#L285

Added line #L285 was not covered by tests
reshape(parent, Base.to_shape(shp))
# resolve ambiguity with Base
reshape(parent::AbstractFillVector, ::Tuple{Colon}) = parent

Check warning on line 288 in src/FillArrays.jl

View check run for this annotation

Codecov / codecov/patch

src/FillArrays.jl#L288

Added line #L288 was not covered by tests
end
reshape(parent::AbstractFill, dims::Dims) = fill_reshape(parent, dims...)
reshape(parent::AbstractFill, dims::Tuple{Integer, Vararg{Integer}}) = fill_reshape(parent, dims...)

# resolve ambiguity with Base
reshape(parent::AbstractFillVector, dims::Tuple{Colon}) = parent

for (AbsTyp, Typ, funcs, func) in ((:AbstractZeros, :Zeros, :zeros, :zero), (:AbstractOnes, :Ones, :ones, :one))
@eval begin
Expand Down
Loading