@@ -116,7 +116,7 @@ Base.size(s::StructArray{<:Any, <:Any, <:EmptyTup}) = (0,)
116116Base. axes (s:: StructArray ) = axes (fieldarrays (s)[1 ])
117117Base. axes (s:: StructArray{<:Any, <:Any, <:EmptyTup} ) = (1 : 0 ,)
118118
119- @generated function Base. getindex (x:: StructArray{T, N, C} , I:: Int... ) where {T, N, C}
119+ Base . @propagate_inbounds @generated function Base. getindex (x:: StructArray{T, N, C} , I:: Int... ) where {T, N, C}
120120 args = [:(getfield (cols, $ i)[I... ]) for i in 1 : fieldcount (C)]
121121 return quote
122122 cols = fieldarrays (x)
@@ -129,9 +129,9 @@ function Base.view(s::StructArray{T, N, C}, I...) where {T, N, C}
129129 StructArray {T} (map (v -> view (v, I... ), fieldarrays (s)))
130130end
131131
132- function Base. setindex! (s:: StructArray , vals, I:: Int... )
132+ Base . @propagate_inbounds function Base. setindex! (s:: StructArray , vals, I:: Int... )
133133 @boundscheck checkbounds (s, I... )
134- @inbounds foreachfield ((col, val) -> (col[I... ] = val), s, vals)
134+ foreachfield ((col, val) -> (@inbounds col[I... ] = val), s, vals)
135135 s
136136end
137137
0 commit comments