Skip to content

Conversation

nsajko
Copy link
Contributor

@nsajko nsajko commented Feb 9, 2025

Backport of PR #56999 to v1.10.

The N<:Integer constraint was nonsensical, given that (N === Any) || (N isa Int). N5N3 noticed this back in 2022:
#44061 (comment)

Follow up on #44061. Also xref #45477.

(cherry picked from commit d3964b6)

…aLang#56999)

The `N<:Integer` constraint was nonsensical, given that `(N === Any) ||
(N isa Int)`. N5N3 noticed this back in 2022:
JuliaLang#44061 (comment)

Follow up on JuliaLang#44061. Also xref JuliaLang#45477.

(cherry picked from commit d3964b6)
@nsajko nsajko mentioned this pull request Feb 9, 2025
33 tasks
Base.ndims(BC::Type{<:Broadcasted{<:Any,Nothing}}) = _maxndims_broadcasted(BC)
# the `AbstractArrayStyle` type parameter is required to be either equal to `Any` or be an `Int` value
Base.ndims(BC::Type{<:Broadcasted{<:AbstractArrayStyle{Any},Nothing}}) = _maxndims_broadcasted(BC)
Base.ndims(::Type{<:Broadcasted{<:AbstractArrayStyle{N},Nothing}}) where {N} = N::Int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth adding a test of this method directly, in addition to the end-to-end broadcasting test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that's a good idea, but this is just a backport PR, new tests should probably go to the master branch.

@KristofferC KristofferC deleted the branch JuliaLang:backports-release-1.10 March 3, 2025 12:51
@KristofferC KristofferC closed this Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants