Skip to content

Commit

Permalink
deduplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
nsajko committed Dec 15, 2024
1 parent 19a4a69 commit 50a04c9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1025,24 +1025,23 @@ end
)
simple_types = (Vector, NTuple, NamedTuple{X, Y} where {X, Y <: NTuple})
example_type = Tuple{Bool, Int8, Vararg{Int16, 20}}
function test_foldability_inference(f, S::Type)
@test Core.Compiler.is_foldable(Base.infer_effects(f, Tuple{S}))
@test Core.Compiler.is_foldable(Base.infer_effects(f, Tuple{Type{<:S}}))
end
@testset "concrete" begin
@testset "f: $f" for f functions
for U iterator_types_extra
S = U{example_type}
@test Core.Compiler.is_foldable(Base.infer_effects(f, Tuple{S}))
@test Core.Compiler.is_foldable(Base.infer_effects(f, Tuple{Type{<:S}}))
test_foldability_inference(f, U{example_type})
end
end
end
@testset "nonconcrete" begin
@testset "f: $f" for f functions
for V simple_types
@test Core.Compiler.is_foldable(Base.infer_effects(f, Tuple{V}))
@test Core.Compiler.is_foldable(Base.infer_effects(f, Tuple{Type{<:V}}))
test_foldability_inference(f, V)
for U iterator_types
S = U{<:V}
@test Core.Compiler.is_foldable(Base.infer_effects(f, Tuple{S}))
@test Core.Compiler.is_foldable(Base.infer_effects(f, Tuple{Type{<:S}}))
test_foldability_inference(f, U{<:V})
end
end
end
Expand Down

0 comments on commit 50a04c9

Please sign in to comment.