Skip to content

Commit bcd0cc1

Browse files
committed
- Simplify after doing type-conversion
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@8600 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent ccdddf9 commit bcd0cc1

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
lines changed

Compiler/FrontEnd/DAE.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ uniontype Exp "Expressions
11301130
end TUPLE;
11311131

11321132
record CAST "Cast operator"
1133-
ExpType ty;
1133+
ExpType ty "This is the full type of this expression, i.e. ET_ARRAY(...) for arrays and matrices";
11341134
Exp exp;
11351135
end CAST;
11361136

Compiler/FrontEnd/ExpressionDump.mo

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -780,23 +780,6 @@ algorithm
780780
then
781781
s;
782782

783-
case (DAE.CAST(ty = DAE.ET_REAL(),exp = DAE.ICONST(integer = ival)), _, _, _)
784-
equation
785-
false = RTOpts.modelicaOutput();
786-
rval = intReal(ival);
787-
res = realString(rval);
788-
then
789-
res;
790-
791-
case (DAE.CAST(ty = DAE.ET_REAL(),exp = DAE.UNARY(operator = DAE.UMINUS(ty = _),exp = DAE.ICONST(integer = ival))), _, _, _)
792-
equation
793-
false = RTOpts.modelicaOutput();
794-
rval = intReal(ival);
795-
res = realString(rval);
796-
res2 = stringAppend("-", res);
797-
then
798-
res2;
799-
800783
case (DAE.CAST(ty = DAE.ET_REAL(),exp = e), _, _, _)
801784
equation
802785
s = printExp2Str(e, stringDelimiter, opcreffunc, opcallfunc);
@@ -2036,15 +2019,6 @@ algorithm
20362019
then
20372020
();
20382021

2039-
case (DAE.CAST(ty = DAE.ET_REAL(),exp = DAE.ICONST(integer = i)),_)
2040-
equation
2041-
false = RTOpts.modelicaOutput();
2042-
r = intReal(i);
2043-
rstr = realString(r);
2044-
Print.printBuf(rstr);
2045-
then
2046-
();
2047-
20482022
case (DAE.CAST(ty = expTy,exp = e),_)
20492023
equation
20502024
false = RTOpts.modelicaOutput();

Compiler/FrontEnd/Types.mo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ protected import Debug;
8181
protected import Error;
8282
protected import Expression;
8383
protected import ExpressionDump;
84+
protected import ExpressionSimplify;
8485
protected import Patternm;
8586
protected import Print;
8687
protected import Util;
@@ -5406,6 +5407,7 @@ algorithm
54065407
equation
54075408
false = subtype(e_type, expected_type);
54085409
(e_1,e_type_1) = typeConvert(e,e_type,expected_type,printFailtrace);
5410+
(e_1,_) = ExpressionSimplify.simplify1(e_1);
54095411
then
54105412
(e_1,e_type_1);
54115413
case (e,e_type,expected_type,true)

0 commit comments

Comments
 (0)