diff --git a/src/vector_of_array.jl b/src/vector_of_array.jl index 8b7172d4..e32d4ddd 100644 --- a/src/vector_of_array.jl +++ b/src/vector_of_array.jl @@ -72,7 +72,7 @@ Base.@propagate_inbounds function Base.getindex(A::AbstractDiffEqArray{T, N},sym end if i === nothing - if issymbollike(i) && A.indepsym !== nothing && Symbol(i) == A.indepsym + if issymbollike(sym) && A.indepsym !== nothing && Symbol(sym) == A.indepsym A.t else observed(A,sym,:) @@ -89,7 +89,7 @@ Base.@propagate_inbounds function Base.getindex(A::AbstractDiffEqArray{T, N},sym end if i === nothing - if issymbollike(i) && A.indepsym !== nothing && Symbol(i) == A.indepsym + if issymbollike(sym) && A.indepsym !== nothing && Symbol(sym) == A.indepsym A.t[args...] else observed(A,sym,args...) diff --git a/test/downstream/symbol_indexing.jl b/test/downstream/symbol_indexing.jl index ecabac6a..7f32198e 100644 --- a/test/downstream/symbol_indexing.jl +++ b/test/downstream/symbol_indexing.jl @@ -21,3 +21,5 @@ sol_new = DiffEqArray( ) @test sol_new[RHS] ≈ (1 .- sol_new[x])./3.0 +@test sol_new[t] ≈ sol_new.t +@test sol_new[t, 1:5] ≈ sol_new.t[1:5] \ No newline at end of file