@descend shows that our compiler fails to inference Base._xfadjoint in this case.
_xfadjoint(op, itr::Generator) =
if itr.f === identity
_xfadjoint(op, itr.iter)
else
_xfadjoint(MappingRF(itr.f, op), itr.iter)
end
It unwraps the nested Generator recursively and forms the new MappingRF.
julia> a = (-i for i in 1:3); b = (-i for i in a); c = (-i for i in b);
julia> Base.return_types(Base._xfadjoint, Base.typesof(+, c))
1-element Vector{Any}:
Tuple{Base.MappingRF{var"#7#8"}, UnitRange{Int64}}
julia> Base.return_types(Base._xfadjoint, Base.typesof(+, b))
1-element Vector{Any}:
Tuple{Base.MappingRF{var"#7#8", Base.MappingRF{var"#9#10", typeof(+)}}, UnitRange{Int64}}
Failure starts with c (three nested layers), which matches our inference constraint on recursion.