Skip to content

Commit

Permalink
Fix inference of iterator mapping (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat authored Nov 30, 2022
1 parent 07567d4 commit e56953d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ for (isVrep, elt, loop_singular) in [(true, :AbstractVector, :point),
iterator(T, ElemT, p...)
end

function $mapit(f::Function, d::FullDim, ::Type{T}, p::$HorVRep...) where {T}
ElemT = promote_type(similar_type.($elemtype.(p), Ref(d), T)...)
function $mapit(f::F, d::FullDim, ::Type{T}, p::Vararg{$HorVRep,N}) where {F<:Function,T,N}
# On Julia v1.8.3, `$elemtype.(p)` leads to inference failure
# but `map($elemtype, p)` works.
ElemT = promote_type(similar_type.(map($elemtype, p), Ref(d), T)...)
iterator(T, ElemT, f, p...)
end

Expand Down

0 comments on commit e56953d

Please sign in to comment.