Skip to content

Commit

Permalink
- Moved connect(a,a) warning to Inst instead of SCode
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11352 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Mar 9, 2012
1 parent a0e3910 commit 581b865
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
10 changes: 10 additions & 0 deletions Compiler/FrontEnd/InstSection.mo
Expand Up @@ -2998,6 +2998,16 @@ algorithm
list<Absyn.ComponentRef> crefs1,crefs2;
String s1,s2;

// adrpo: check for connect(A, A) as we should give a warning and remove it!
case (cache,env,ih,sets,pre,c1,c2,impl,graph,info)
equation
true = Absyn.crefEqual(c1, c2);
s1 = Dump.printComponentRefStr(c1);
s2 = Dump.printComponentRefStr(c1);
Error.addSourceMessage(Error.SAME_CONNECT_INSTANCE, {s1, s2}, info);
then
(cache, env, ih, sets, DAEUtil.emptyDae, graph);

// Check if either of the components are conditional components with
// condition = false, in which case we should not instantiate the connection.
case (cache,env,ih,sets,pre,c1,c2,impl,graph,info)
Expand Down
11 changes: 0 additions & 11 deletions Compiler/FrontEnd/SCodeUtil.mo
Expand Up @@ -1547,17 +1547,6 @@ algorithm

case {} then {};

// adrpo: check for connect(A, A) as we should give a warning and remove it!
case (Absyn.EQUATIONITEM(equation_ = Absyn.EQ_CONNECT(c1, c2),comment = acom,info = info) :: es)
equation
true = Absyn.crefEqual(c1, c2);
s1 = Dump.printComponentRefStr(c1);
s2 = Dump.printComponentRefStr(c1);
Error.addSourceMessage(Error.SAME_CONNECT_INSTANCE, {s1, s2}, info);
es_1 = translateEquations(es);
then
(es_1);

case (Absyn.EQUATIONITEM(equation_ = e,comment = acom,info = info) :: es)
equation
// Debug.fprintln(Flags.TRANSLATE, "translating equation: " +& Dump.unparseEquationStr(0, e));
Expand Down

0 comments on commit 581b865

Please sign in to comment.