Skip to content

Commit

Permalink
Fixes for ticket:4007
Browse files Browse the repository at this point in the history
Updated cseTestCall1.mos, which used an illegal function call. Added
a test case for tuples not on the LHS.
  • Loading branch information
sjoelund committed Sep 7, 2016
1 parent 9f36c1c commit 07e45ab
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions flattening/modelica/algorithms-functions/Makefile
Expand Up @@ -96,6 +96,7 @@ Summation.mo \
SumSeriesWhile.mo \
SumVectorForIf.mo \
TestGravityAcceleration.mo \
TupleError.mo \
TupleSingleAssign.mo \
TupleAssignmentMismatch1.mo \
tupleSubset.mo \
Expand Down
16 changes: 16 additions & 0 deletions flattening/modelica/algorithms-functions/TupleError.mo
@@ -0,0 +1,16 @@
// status: incorrect
// Based on ticket:4007

model TupleError
Real a = (0,25)*(0,25);
end TupleError;
// Result:
// Error processing file: TupleError.mo
// [flattening/modelica/algorithms-functions/TupleError.mo:5:3-5:25:writable] Error: Tuple expressions may only occur on the left side of an assignment or equation with a single function call on the right side. Got the following expression: (0, 25).
// Error: Error occurred while flattening model TupleError
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
//
// Execution failed!
// endResult
4 changes: 2 additions & 2 deletions simulation/modelica/commonSubExp/cseTestCall1.mos
Expand Up @@ -11,7 +11,7 @@ package CSE
Real C = time+1.0;
Real D;
Real E;

function f
input Real s;
output Real a;
Expand All @@ -22,7 +22,7 @@ package CSE
end f;

equation
f(time) = (x,y);
(x,y) = f(time);
A = B*C;
D = log(B*C);
E = B*C + log(log(log(B*C)));
Expand Down

0 comments on commit 07e45ab

Please sign in to comment.