Skip to content

Commit 2fca7f4

Browse files
fix: fix usage of deprecated property in toexpr of ArrayOp
1 parent 47fd174 commit 2fca7f4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/arrays.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ end
976976
### Codegen
977977

978978
function SymbolicUtils.Code.toexpr(x::ArrayOp, st)
979-
haskey(st.symbolify, x) && return st.symbolify[x]
979+
haskey(st.rewrites, x) && return st.rewrites[x]
980980

981981
if iscall(x.term)
982982
toexpr(x.term, st)

test/build_function.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Symbolics, SparseArrays, LinearAlgebra, Test
22
using ReferenceTests
33
using Symbolics: value
4-
using SymbolicUtils.Code: DestructuredArgs, Func
4+
using SymbolicUtils.Code: DestructuredArgs, Func, NameState
55
@variables a b c1 c2 c3 d e g
66
oop, iip = Symbolics.build_function([sqrt(a), sin(b)], [a, b], nanmath = true)
77
@test all(isnan, eval(oop)([-1, Inf]))
@@ -275,3 +275,9 @@ let #658
275275
k = eval(build_function(a * X1 + X2, X1, X2, a)[2])
276276
@test k(ones(3), ones(3), 1.5) == [2.5, 2.5, 2.5]
277277
end
278+
279+
@testset "ArrayOp codegen" begin
280+
@variables x[1:2]
281+
T = value(x .^ 2)
282+
@test_nowarn toexpr(T, NameState())
283+
end

0 commit comments

Comments
 (0)