Skip to content

Commit

Permalink
Fix for #2557
Browse files Browse the repository at this point in the history
- propely display the warning message
- add the line number information to the warning message too


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18932 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Feb 2, 2014
1 parent d27739e commit 7e3423d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Compiler/BackEnd/Initialization.mo
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ protected import HashTable3;
protected import HashTableCG;
protected import List;
protected import Matching;
protected import DAEUtil;

// =============================================================================
// section for all public functions
Expand Down Expand Up @@ -1626,6 +1627,7 @@ algorithm
BackendDAE.VarKind varKind;
HashSet.HashSet hs;
String s, str;
Absyn.Info info;

// state
case((var as BackendDAE.VAR(varName=cr, varKind=BackendDAE.STATE(index=_), varType=ty), (vars, fixvars, eqns, hs))) equation
Expand Down Expand Up @@ -1709,9 +1711,10 @@ algorithm
var = BackendVariable.setBindExp(var, SOME(startExp));
var = BackendVariable.setVarFixed(var, true);

s = BackendDump.varString(var);
s = ComponentReference.printComponentRefStr(BackendVariable.varCref(var));
str = ExpressionDump.printExpStr(startExp);
Error.addMessage(Error.UNBOUND_PARAMETER_WITH_START_VALUE_WARNING, {s, str});
info = DAEUtil.getElementSourceFileInfo(BackendVariable.getVarSource(var));
Error.addSourceMessage(Error.UNBOUND_PARAMETER_WITH_START_VALUE_WARNING, {s, str}, info);

vars = BackendVariable.addVar(var, vars);
then ((var, (vars, fixvars, eqns, hs)));
Expand Down

0 comments on commit 7e3423d

Please sign in to comment.