Skip to content

Commit 96f7a27

Browse files
fix: fix getname on array symbolic functions with interpolated names
1 parent 5e5315b commit 96f7a27

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/variable.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ function construct_dep_array_vars(macroname, lhs, type, call_args, indices, val,
227227
if val !== nothing
228228
ex = :($setdefaultval($ex, $val))
229229
end
230-
ex = setprops_expr(ex, prop, macroname, Meta.quot(vname))
230+
ex = setprops_expr(ex, prop, macroname, _vname)
231231
#ex = :($scalarize_getindex($ex))
232232

233233
ex = :($wrap($ex))

test/macro.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,3 +435,10 @@ end
435435
@test isequal(f, ff)
436436
@test hash(f) == hash(ff)
437437
end
438+
439+
# https://github.com/SciML/ModelingToolkitNeuralNets.jl/issues/58
440+
@testset "`getname` on symbolic functions returning arrays with interpolated names" begin
441+
name1 = :f1
442+
vs = @variables $name1(..)[1:3]
443+
@test getname(vs[1]) == name1
444+
end

0 commit comments

Comments
 (0)