diff --git a/flattening/modelica/algorithms-functions/ArrayRange.mo b/flattening/modelica/algorithms-functions/ArrayRange.mo new file mode 100644 index 00000000000..9794475ec05 --- /dev/null +++ b/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 diff --git a/flattening/modelica/algorithms-functions/Makefile b/flattening/modelica/algorithms-functions/Makefile index 9edc855af9a..c118cacb436 100644 --- a/flattening/modelica/algorithms-functions/Makefile +++ b/flattening/modelica/algorithms-functions/Makefile @@ -15,6 +15,7 @@ AlgorithmFor5.mo \ AlgorithmFor6.mo \ AlgorithmNoRetCall.mo \ AlgorithmSection.mo \ +ArrayRange.mo \ AssignmentToInput.mo \ AssignmentErrorConstant.mo\ AssignmentErrorInput.mo \