Skip to content

Commit

Permalink
allow up to 5 max methods for ntuple (JuliaLang#54528)
Browse files Browse the repository at this point in the history
Co-authored-by: KristofferC <[email protected]>
  • Loading branch information
2 people authored and lazarusA committed Jul 12, 2024
1 parent 708f1ea commit 3bc4850
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/ntuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ julia> ntuple(i -> 2*i, Val(4))
Tuple(f(i) for i = 1:N)
end
end
typeof(function ntuple end).name.max_methods = UInt8(5)

@inline function fill_to_length(t::Tuple, val, ::Val{_N}) where {_N}
M = length(t)
Expand Down
2 changes: 2 additions & 0 deletions test/tuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,8 @@ end

f() = Base.setindex((1:1, 2:2, 3:3), 9, 1)
@test @inferred(f()) == (9, 2:2, 3:3)

@test Base.return_types(Base.setindex, Tuple{Tuple,Nothing,Int}) == [Tuple]
end

@testset "inferable range indexing with constant values" begin
Expand Down

0 comments on commit 3bc4850

Please sign in to comment.