Skip to content

Commit

Permalink
Allow DIM_EXP():=DIM_EXP() (do run-time checks since we cannot do eve…
Browse files Browse the repository at this point in the history
…rything at compile-time)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@21796 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Aug 7, 2014
1 parent cf88681 commit f21f70d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Compiler/FrontEnd/Types.mo
Expand Up @@ -4539,27 +4539,29 @@ algorithm
then
(e_1,DAE.T_ARRAY(t_1,{DAE.DIM_UNKNOWN()},ts2));

// Arbitrary expressions, expression dimension [:] expected dimension [:]
// Arbitrary expression, expression dimension [dim1] expected dimension [:]
case (e,
DAE.T_ARRAY(dims = {DAE.DIM_UNKNOWN()},ty = ty1),
DAE.T_ARRAY(dims = {DAE.DIM_UNKNOWN()},ty = ty2,source = ts2),
DAE.T_ARRAY(dims = {dim1},ty = ty1),
DAE.T_ARRAY(dims = {DAE.DIM_UNKNOWN()},ty = ty2, source = ts2),
_)
equation
(e_1,t_1) = typeConvert(e, ty1, ty2, printFailtrace);
e_1 = liftExpType(e_1,DAE.DIM_UNKNOWN());
e_1 = liftExpType(e_1,dim1);
then
(e_1,DAE.T_ARRAY(t_1,{DAE.DIM_UNKNOWN()},ts2));
(e_1,DAE.T_ARRAY(t_1,{dim1},ts2));

// Arbitrary expression, expression dimension [dim1] expected dimension [:]
// Arbitrary expressions, expression dimension [:] expected dimension [:]
case (e,
DAE.T_ARRAY(dims = {dim1},ty = ty1),
DAE.T_ARRAY(dims = {DAE.DIM_UNKNOWN()},ty = ty2, source = ts2),
DAE.T_ARRAY(dims = {dim2},ty = ty2,source = ts2),
_)
equation
false = Expression.dimensionKnown(dim1);
false = Expression.dimensionKnown(dim2);
(e_1,t_1) = typeConvert(e, ty1, ty2, printFailtrace);
e_1 = liftExpType(e_1,dim1);
e_1 = liftExpType(e_1,DAE.DIM_UNKNOWN());
then
(e_1,DAE.T_ARRAY(t_1,{dim1},ts2));
(e_1,DAE.T_ARRAY(t_1,{DAE.DIM_UNKNOWN()},ts2));

// Tuple
case (DAE.TUPLE(PR = elist),
Expand Down

0 comments on commit f21f70d

Please sign in to comment.