From dfe521e8c887e309bec426cb428019559b9d10e9 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 27 Jan 2018 15:56:52 -0500 Subject: [PATCH] ensure that inbounds get propagated --- src/StructsOfArrays.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/StructsOfArrays.jl b/src/StructsOfArrays.jl index eb4226a..be243d8 100644 --- a/src/StructsOfArrays.jl +++ b/src/StructsOfArrays.jl @@ -70,7 +70,7 @@ end @generated function Base.getindex{T}(A::StructOfArrays{T}, i::Integer...) strct, _ = generate_getindex(T, 1) - Expr(:block, Expr(:meta, :inline), strct) + Expr(:block, Expr(:meta, :inline), Expr(:meta, :propagate_inbounds), strct) end function generate_setindex(T, x, arraynum) @@ -92,7 +92,8 @@ end @generated function Base.setindex!{T}(A::StructOfArrays{T}, x, i::Integer...) exprs = Expr(:block, generate_setindex(T, :x, 1)[1]...) quote - $(Expr(:meta, :inline)) + Base.@_inline_meta + Base.@_propagate_inbounds_meta v = convert(T, x) $exprs x