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

Commit

Permalink
[NF] Move overconstrained equation generation.
Browse files Browse the repository at this point in the history
- Move the generation of equations for overconstrained connections from
  Typing to Flattening, so that it can handle e.g. iterators correctly.

Belonging to [master]:
  - #2832
  - OpenModelica/OpenModelica-testsuite#1091
  • Loading branch information
perost authored and OpenModelica-Hudson committed Dec 13, 2018
1 parent 53a0dfd commit 35cf6f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Compiler/NFFrontEnd/NFOCConnectionGraph.mo
Expand Up @@ -171,7 +171,6 @@ algorithm
eql := match eq
case Equation.CONNECT(lhs = Expression.CREF(ty = ty1, cref = lhs),
rhs = Expression.CREF(ty = ty2, cref = rhs),
broken = eqlBroken,
source = source)
algorithm
added := false;
Expand All @@ -197,7 +196,8 @@ algorithm
lhs := ComponentRef.stripSubscripts(lhs);
rhs := ComponentRef.stripSubscripts(rhs);

graph := addConnection(graph, lhs, rhs, eqlBroken);
eq.broken := generateEqualityConstraintEquation(eq.lhs, ty1, eq.rhs, ty2, ExpOrigin.EQUATION, source);
graph := addConnection(graph, lhs, rhs, eq.broken);
added := true;
break;
end if;
Expand Down
7 changes: 1 addition & 6 deletions Compiler/NFFrontEnd/NFTyping.mo
Expand Up @@ -2475,12 +2475,7 @@ algorithm
// fail();
//end if;

// @adrpo: here we see if we have any overconstrained connectors in the connect
// if we do, we generate equation:
// zeros(:) = OverconstrainedType.equalityConstraint(lhs.overconstrained_component, rhs.overconstrained_component)
eql := NFOCConnectionGraph.generateEqualityConstraintEquation(lhs, lhs_ty, rhs, rhs_ty, origin, source);

connEq := Equation.CONNECT(lhs, rhs, eql, source);
connEq := Equation.CONNECT(lhs, rhs, {}, source);
end typeConnect;

function typeExpandableConnectors
Expand Down

0 comments on commit 35cf6f8

Please sign in to comment.