Skip to content

Commit

Permalink
Added test for #3421.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost committed Sep 9, 2015
1 parent aff54d9 commit de547c1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions flattening/modelica/algorithms-functions/Makefile
Expand Up @@ -97,6 +97,7 @@ SumSeriesWhile.mo \
SumVectorForIf.mo \
TestGravityAcceleration.mo \
TupleSingleAssign.mo \
TupleAssignmentMismatch1.mo \
tupleSubset.mo \
UnusedInput.mo \
UnknownDimensionFunctionCall.mo \
Expand Down
@@ -0,0 +1,33 @@
// name: TupleAssignmentMismatch1
// keywords: algorithm, tuple, assignment, #3421
// status: incorrect
//
// Checks that too many tuple elements generate an error when assigning a
// function call to a tuple.
//

model TupleAssignmentMismatch1
function f
output Real r1;
output Real r2;
algorithm
r1 := 1.0;
r2 := 2.0;
end f;

Real x, y, z;
algorithm
(x, y, z) := f();
end TupleAssignmentMismatch1;


// Result:
// Error processing file: TupleAssignmentMismatch1.mo
// [flattening/modelica/algorithms-functions/TupleAssignmentMismatch1.mo:20:3-20:19:writable] Error: Type mismatch in assignment in (x, y, z) := f() of (Real, Real, Real) := (Real, Real)
// Error: Error occurred while flattening model TupleAssignmentMismatch1
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
//
// Execution failed!
// endResult

0 comments on commit de547c1

Please sign in to comment.