Skip to content

Commit

Permalink
-Changed error messages for unbound parameters.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@6135 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Sep 15, 2010
1 parent 91cb5d0 commit 582991d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Compiler/Error.mo
Expand Up @@ -475,9 +475,9 @@ protected constant list<tuple<Integer, MessageType, Severity, String>> errorTabl
(PACKAGE_VARIABLE_NOT_CONSTANT, TRANSLATION(),ERROR(),"Variable %s in package %s is not constant"),
(RECURSIVE_DEFINITION,TRANSLATION(),ERROR(),"Class %s has a recursive definition, i.e. contains an instance of itself"),
(UNBOUND_PARAMETER_WARNING,TRANSLATION(),WARNING(),
"Parameter %s has no value or start attribute, and is fixed during initialization (fixed=true)"),
"Parameter %s has neither value nor start value, and is fixed during initialization (fixed=true)"),
(UNBOUND_PARAMETER_WITH_START_VALUE_WARNING,TRANSLATION(),WARNING(),
"Using available start value (start=%s) as default value for parameter %s that has no value"),
"Parameter %s has no value, and is fixed during initialization (fixed=true), using available start value (start=%s) as default value"),
(BUILTIN_FUNCTION_SUM_HAS_SCALAR_PARAMETER,TRANSLATION(),WARNING(),
"Function \"sum\" has scalar as argument in %s in component %s"),
(BUILTIN_FUNCTION_PRODUCT_HAS_SCALAR_PARAMETER,TRANSLATION(),WARNING(),
Expand Down
3 changes: 2 additions & 1 deletion Compiler/Static.mo
Expand Up @@ -10911,11 +10911,12 @@ algorithm
// adrpo: report a warning if the binding came from a start value!
case (cache,env,cr,acc,SCode.PARAM(),forIteratorConstOpt,io,tt,bind as DAE.EQBOUND(source = DAE.BINDING_FROM_START_VALUE()),doVect,splicedExpData,inPrefix)
equation
true = Types.getFixedVarAttribute(tt);
s = Exp.printComponentRefStr(cr);
pre_str = PrefixUtil.printPrefixStr2(inPrefix);
s = pre_str +& s;
str = DAEUtil.printBindingExpStr(inBinding);
Error.addMessage(Error.UNBOUND_PARAMETER_WITH_START_VALUE_WARNING(), {str, s});
Error.addMessage(Error.UNBOUND_PARAMETER_WITH_START_VALUE_WARNING(), {s,str});
bind = DAEUtil.setBindingSource(bind, DAE.BINDING_FROM_DEFAULT_VALUE());
(cache, e_1, const, acc) = elabCref2(cache,env,cr,acc,inVariability,forIteratorConstOpt,io,tt,bind,doVect,splicedExpData,inPrefix);
then
Expand Down

0 comments on commit 582991d

Please sign in to comment.