Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error handling of inner/outer.
- Give an error and fail if a simulation model contains a top-level outer, since the model should only be usable as part of another model in that case (unless doing checkModel). - Give an error and fail if a simulation model has a missing inner component and also a top-level element with the same name, since the generated inner would then conflict with the existing element.
- Loading branch information
Showing
9 changed files
with
90 additions
and
13 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
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
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
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
25 changes: 25 additions & 0 deletions
25
testsuite/flattening/modelica/scodeinst/InnerOuterMissing7.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,25 @@ | ||
// name: InnerOuterMissing7 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model A | ||
outer Real x; | ||
end A; | ||
|
||
model InnerOuterMissing7 | ||
A a; | ||
Real x; | ||
end InnerOuterMissing7; | ||
|
||
// Result: | ||
// Error processing file: InnerOuterMissing7.mo | ||
// [flattening/modelica/scodeinst/InnerOuterMissing7.mo:13:3-13:9:writable] Notification: From here: | ||
// [flattening/modelica/scodeinst/InnerOuterMissing7.mo:8:3-8:15:writable] Error: An inner declaration for outer component ‘x‘ could not be found, and could not be automatically generated due to a existing declaration of that name. | ||
// | ||
// # 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