Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix type checking of cref binding equations (#12371)
- Handle component references with split indices in `TypeCheck.elaborateBindingType`. Fixes #12367
- Loading branch information
Showing
5 changed files
with
69 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// name: BuiltinAttribute23 | ||
// name: BuiltinAttribute24 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
|
21 changes: 21 additions & 0 deletions
21
testsuite/flattening/modelica/scodeinst/BuiltinAttribute25.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,21 @@ | ||
// name: BuiltinAttribute25 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model BuiltinAttribute25 | ||
parameter Real x_start[:] = {1, 2}; | ||
Real x[3](start = x_start); | ||
end BuiltinAttribute25; | ||
|
||
// Result: | ||
// Error processing file: BuiltinAttribute25.mo | ||
// [flattening/modelica/scodeinst/BuiltinAttribute25.mo:9:13-9:28:writable] Notification: From here: | ||
// [flattening/modelica/scodeinst/BuiltinAttribute25.mo:9:3-9:29:writable] Error: Type mismatch in binding 'start = x_start', expected array dimensions [3], got [2]. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
21 changes: 21 additions & 0 deletions
21
testsuite/flattening/modelica/scodeinst/BuiltinAttribute26.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,21 @@ | ||
// name: BuiltinAttribute26 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model BuiltinAttribute26 | ||
parameter Real x_start[:, :] = {{1, 2, 3, 4}, {5, 6, 7, 8}}; | ||
Real x[3](start = x_start[1]); | ||
end BuiltinAttribute26; | ||
|
||
// Result: | ||
// Error processing file: BuiltinAttribute26.mo | ||
// [flattening/modelica/scodeinst/BuiltinAttribute26.mo:9:13-9:31:writable] Notification: From here: | ||
// [flattening/modelica/scodeinst/BuiltinAttribute26.mo:9:3-9:32:writable] Error: Type mismatch in binding 'start = x_start[1]', expected array dimensions [3], got [4]. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
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