Skip to content

Commit 02a4c85

Browse files
committed
Handle vector valued variables correctly in get_connection_type
1 parent 4c30760 commit 02a4c85

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/systems/connectors.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
get_connection_type(s) = getmetadata(unwrap(s), VariableConnectType, Equality)
1+
function get_connection_type(s)
2+
s = unwrap(s)
3+
if istree(s) && operation(s) === getindex
4+
s = arguments(s)[1]
5+
end
6+
getmetadata(s, VariableConnectType, Equality)
7+
end
28

39
function with_connector_type(expr)
410
@assert expr isa Expr && (expr.head == :function || (expr.head == :(=) &&

0 commit comments

Comments
 (0)