Skip to content

Commit

Permalink
- better error message for not handled when equation.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13844 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Nov 8, 2012
1 parent e07e8be commit feed368
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Compiler/BackEnd/BackendDAECreate.mo
Expand Up @@ -1452,7 +1452,7 @@ algorithm
DAE.Exp cond;
list<DAE.Element> eqnl;
DAE.Element elsePart;
String scond;
String scond, str;
DAE.ElementSource source;

case (DAE.WHEN_EQUATION(condition = cond,equations = eqnl,elsewhen_ = NONE(),source=source),_,_,_)
Expand All @@ -1469,17 +1469,17 @@ algorithm
(cond,source,_) = Inline.inlineExp(cond, (SOME(functionTree),{DAE.NORM_INLINE()}), source);
(trueEqnLst,reinit) = lowerWhenEqn2(listReverse(eqnl), cond, functionTree, {}, {});
whenClauseList = makeWhenClauses(listLength(reinit) > 0, cond, reinit,whenClauseList);
res = mergeClauses(trueEqnLst,elseEqnLst,inEquationLst);
res = mergeClauses(trueEqnLst,elseEqnLst,inEquationLst);
then
(res,whenClauseList);

case (DAE.WHEN_EQUATION(condition = cond),_,_,_)
case (DAE.WHEN_EQUATION(condition = cond, source = source),_,_,_)
equation
scond = ExpressionDump.printExpStr(cond);
print("- BackendDAECreate.lowerWhenEqn: Error in lowerWhenEqn. \n when ");
print(scond);
print(" ... \n");
then fail();
str = "BackendDAECreate.lowerWhenEqn: equation not handled:\n" +&
DAEDump.dumpElementsStr({inElement});
Error.addSourceMessage(Error.INTERNAL_ERROR, {str}, DAEUtil.getElementSourceFileInfo(source));
then
fail();
end matchcontinue;
end lowerWhenEqn;

Expand Down

0 comments on commit feed368

Please sign in to comment.