Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
flattening/modelica/algorithms-functions/TupleAssignmentMismatch1.mo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |