Type issue in for loop over items in struct field

Now, that’s more complicated, because your op_vec must be an abstract container, to support different types of BasisOperations. You’ll need to use some type of sum types. For example, for a recently posted and useful package:

julia> using DynamicSumTypes

julia> @sumtype SumTypeBasisOperations(AOperation, BOperation) <: BasisOperation
SumTypeBasisOperations

julia> function fun_test2()
           aux = Aux(SumTypeBasisOperations[AOperation(), BOperation()])
           for op in aux.op_vec
               continue
           end
       end
fun_test2 (generic function with 1 method)

julia> @code_warntype fun_test2() # clean

see: [ANN] DynamicSumTypes.jl v3