Skip to content

Commit 88d2c6f

Browse files
committed
Fix kind check for array variables
1 parent 0a36928 commit 88d2c6f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/parameters.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ struct MTKParameterCtx end
44
function isparameter(x)
55
x = unwrap(x)
66

7+
if x isa Symbolic && (isp = getmetadata(x, MTKParameterCtx, nothing)) !== nothing
8+
return isp
79
#TODO: Delete this branch
8-
if x isa Symbolic && Symbolics.getparent(x, false) !== false
10+
elseif x isa Symbolic && Symbolics.getparent(x, false) !== false
911
p = Symbolics.getparent(x)
1012
isparameter(p) ||
1113
(hasmetadata(p, Symbolics.VariableSource) &&

src/variables.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ struct Stream <: AbstractConnectType end # special stream connector
2020

2121
isvarkind(m, x::Num) = isvarkind(m, value(x))
2222
function isvarkind(m, x)
23-
p = getparent(x, nothing)
24-
p === nothing || (x = p)
23+
iskind = getmetadata(x, m, nothing)
24+
iskind !== nothing && return iskind
25+
x = getparent(x, x)
2526
getmetadata(x, m, false)
2627
end
2728

0 commit comments

Comments
 (0)