Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit eeb0df6

Browse files
rfrankeOpenModelica-Hudson
authored andcommitted
[NF] Treat arrays of overconstrained connectors
A Connections.branch argument may be an element of an array of connectors. Belonging to [master]: - #2798 - OpenModelica/OpenModelica-testsuite#1081
1 parent 17cf378 commit eeb0df6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Compiler/NFFrontEnd/NFBuiltinCall.mo

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ encapsulated package NFBuiltinCall
3838
import NFInstNode.InstNode;
3939
import NFPrefixes.Variability;
4040
import Type = NFType;
41+
import Subscript = NFSubscript;
4142

4243
protected
4344
import Config;
@@ -1531,14 +1532,19 @@ protected
15311532
Type ty2;
15321533
InstNode node;
15331534
Boolean valid_cref;
1534-
ComponentRef rest_cref;
15351535

15361536
case Expression.CREF()
15371537
algorithm
15381538
valid_cref := match arg.cref
15391539
case ComponentRef.CREF(node = node, origin = NFComponentRef.Origin.CREF,
1540-
restCref = ComponentRef.CREF(ty = ty2, origin = NFComponentRef.Origin.CREF,
1541-
restCref = rest_cref))
1540+
restCref = ComponentRef.CREF(ty = ty2, origin = NFComponentRef.Origin.CREF))
1541+
algorithm
1542+
ty2 := match ty2
1543+
case Type.ARRAY()
1544+
guard listLength(ComponentRef.subscriptsAllFlat(arg.cref)) == listLength(ty2.dimensions)
1545+
then ty2.elementType;
1546+
else ty2;
1547+
end match;
15421548
then Class.isOverdetermined(InstNode.getClass(node)) and
15431549
Type.isConnector(ty2);
15441550

0 commit comments

Comments
 (0)