Skip to content

Commit

Permalink
- Fixed handling of partially bound record in CevalFunction.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10659 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Dec 6, 2011
1 parent 7812ec3 commit a789be6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Compiler/FrontEnd/CevalFunction.mo
Expand Up @@ -2385,21 +2385,23 @@ algorithm
Values.Value val;
String id;
DAE.Type ty;
DAE.Binding binding;

// The component is a record itself.
case (DAE.TYPES_VAR(
name = id,
ty = ty as DAE.T_COMPLEX(complexClassType = ClassInf.RECORD(path = _))), _)
ty = ty as DAE.T_COMPLEX(complexClassType = ClassInf.RECORD(path = _))), _)
equation
val = getRecordValue(Absyn.IDENT(id), ty, inEnv);
then
val;

// A non-record variable.
case (DAE.TYPES_VAR(name = id), _)
case (DAE.TYPES_VAR(name = id, ty = ty), _)
equation
(_, DAE.TYPES_VAR(binding = DAE.VALBOUND(valBound = val)), _, _, _) =
(_, DAE.TYPES_VAR(binding = binding), _, _, _) =
Lookup.lookupIdentLocal(Env.emptyCache(), inEnv, id);
val = getBindingOrDefault(binding, ty);
then
val;
end match;
Expand Down

0 comments on commit a789be6

Please sign in to comment.