Skip to content

Commit 8b52a80

Browse files
committed
Test maketerm keeping array type when symtype is Array
1 parent f0bd7e4 commit 8b52a80

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/basics.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ end
249249
@syms x::Int y::Int
250250
new_expr = SymbolicUtils.maketerm(typeof(ref_expr), (+), [x, y], nothing)
251251
@test symtype(new_expr) == Int64
252+
253+
# Check that the Array type does not get changed to AbstractArray
254+
new_expr = SymbolicUtils.maketerm(
255+
SymbolicUtils.BasicSymbolic{Vector{Float64}}, sin, [1.0, 2.0], nothing)
256+
@test symtype(new_expr) == Vector{Float64}
252257
end
253258

254259
toterm(t) = Term{symtype(t)}(operation(t), arguments(t))

0 commit comments

Comments
 (0)