If you check out the master branch of AxisArrays.jl (currently, this is commit 4d2f8ccc08d582adcf0a029d28f5ccd12b72f406), then the following script succeeds with normal inlining but hangs during inference with --inline=no:
using AxisArrays
Base.reduced_indices(A::AxisArray, region) = reduced_indices(axes(A), region)
@inline reduced_indices{Ax<:Axis}(axs::Tuple{Vararg{Axis}}, region::Type{Ax}) =
_reduced_indices(reduced_axis, (), region, axs...)
@inline _reduced_indices{name}(f, out, chosen::Type{Axis{name}}, ax::Axis{name}, axs...) =
_reduced_indices(f, (out..., f(ax)), chosen, axs...)
@inline _reduced_indices{name}(f, out, chosen::Axis{name}, ax::Axis{name}, axs...) =
_reduced_indices(f, (out..., f(ax)), chosen, axs...)
@inline _reduced_indices(f, out, chosen, ax::Axis, axs...) =
_reduced_indices(f, (out..., ax), chosen, axs...)
_reduced_indices(f, out, chosen) = out
reduced_axis(ax) = ax(oftype(ax.val, Base.OneTo(1)))
C = AxisArray(collect(reshape(1:15,3,5)), :y, :x)
sum(C, Axis{:x})
Observed in JuliaArrays/AxisArrays.jl#56.
If you check out the master branch of AxisArrays.jl (currently, this is commit 4d2f8ccc08d582adcf0a029d28f5ccd12b72f406), then the following script succeeds with normal inlining but hangs during inference with
--inline=no:Observed in JuliaArrays/AxisArrays.jl#56.