Skip to content

Commit

Permalink
Add testcase for #3422
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Sep 9, 2015
1 parent 27a774a commit aff54d9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions flattening/modelica/algorithms-functions/ArrayRange.mo
@@ -0,0 +1,20 @@
// status: incorrect

model ArrayRange
Real x[4, 2];
algorithm
for elem in {{1, 2}, {3, 4}, {5, 6}, {7, 8}} loop
x[div(elem[2], 2), :] := elem;
end for;
end ArrayRange;

// Result:
// Error processing file: ArrayRange.mo
// [flattening/modelica/algorithms-functions/ArrayRange.mo:6:3-8:10:writable] Error: Iterator elem, has type Integer[4, 2], but expected a 1D array expression.
// Error: Error occurred while flattening model ArrayRange
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
//
// Execution failed!
// endResult
1 change: 1 addition & 0 deletions flattening/modelica/algorithms-functions/Makefile
Expand Up @@ -15,6 +15,7 @@ AlgorithmFor5.mo \
AlgorithmFor6.mo \
AlgorithmNoRetCall.mo \
AlgorithmSection.mo \
ArrayRange.mo \
AssignmentToInput.mo \
AssignmentErrorConstant.mo\
AssignmentErrorInput.mo \
Expand Down

0 comments on commit aff54d9

Please sign in to comment.