Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve check for access into partial package (#9214)
- Enable the previously disabled check for access into a partial package in Lookup.lookupLocalNames, but disable it for PartialModelicaServices to work around the reason why it was disabled in the first place.
- Loading branch information
Showing
3 changed files
with
38 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// name: PartialLookup3 | ||
// keywords: lookup partial redeclare | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// Checks that it's not allowed to look up a name in a partial class. | ||
// | ||
|
||
package P | ||
partial package P2 | ||
model A | ||
Real x; | ||
end A; | ||
end P2; | ||
end P; | ||
|
||
model PartialLookup3 | ||
extends P.P2.A; | ||
end PartialLookup3; | ||
|
||
// Result: | ||
// Error processing file: PartialLookup3.mo | ||
// [flattening/modelica/scodeinst/PartialLookup3.mo:18:3-18:17:writable] Error: P2 is partial, name lookup is not allowed in partial classes. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |