Skip to content

Commit

Permalink
Put nospecialize in Zip related functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Jan 13, 2019
1 parent 6c014f8 commit 8df3887
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/library.jl
Expand Up @@ -1396,11 +1396,13 @@ Setfield.constructor_of(::Type{T}) where {T <: Joiner} = T

# It's ugly that `Reduction` returns a non-`Reduction` type! TODO: fix it
function Reduction(xf::Composition{<:TeeZip}, f, intype::Type)
@nospecialize
rf, lens = _teezip_rf(xf.outer.xform, intype, (xf.inner, f, intype))
return Splitter(rf, lens)
end

function Reduction(xf::TeeZip, f, intype::Type)
@nospecialize
# TODO: Don't use Map(identity) here. (ATM, required for correct
# InType.)
rf, lens = _teezip_rf(xf.xform, intype, (nothing, f, intype))
Expand All @@ -1412,6 +1414,7 @@ end
# `TeeZip`. But this doesn't work ATM since `@lens _.inner` is
# hard-coded.
function _teezip_rf(xf::Composition, intype, downstream)
@nospecialize
intype_inner = outtype(xf.outer, intype)
rf_inner, lens_inner = _teezip_rf(xf.inner, intype_inner, downstream)
rf = Reduction(xf.outer, rf_inner, intype)
Expand All @@ -1422,6 +1425,7 @@ function _teezip_rf(xf::Composition, intype, downstream)
end

function _teezip_rf(xf, intype, downstream)
@nospecialize
xf_ds, f, intype_orig = downstream
intype_ds = Tuple{intype_orig, outtype(xf, intype)}
if xf_ds === nothing
Expand Down

0 comments on commit 8df3887

Please sign in to comment.