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
1 parent
225b295
commit c5c6f9a
Showing
4 changed files
with
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// name: ExtendSelf1.mo | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// Checks that a class can extend a local class via itself. | ||
// | ||
|
||
model ExtendSelf1 | ||
encapsulated model A | ||
Real x = 1; | ||
end A; | ||
|
||
extends ExtendSelf1.A; | ||
end ExtendSelf1; | ||
|
||
// Result: | ||
// class ExtendSelf1 | ||
// Real x = 1; | ||
// end ExtendSelf1; | ||
// 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// name: ExtendSelf2.mo | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// Checks that an extends loop gives an error. | ||
// | ||
|
||
model A | ||
extends ExtendSelf2; | ||
end A; | ||
|
||
model ExtendSelf2 | ||
extends A; | ||
end ExtendSelf2; | ||
|
||
// Result: | ||
// Error processing file: ExtendSelf2.mo | ||
// [flattening/modelica/scodeinst/ExtendSelf2.mo:10:3-10:22:writable] Error: extends ExtendSelf2 causes an instantiation loop. | ||
// | ||
// # 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// name: ExtendSelf3.mo | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// Checks that a class extending from itself gives an error. | ||
// | ||
|
||
model ExtendSelf3 | ||
extends ExtendSelf3; | ||
end ExtendSelf3; | ||
|
||
// Result: | ||
// Error processing file: ExtendSelf3.mo | ||
// [flattening/modelica/scodeinst/ExtendSelf3.mo:10:3-10:22:writable] Error: extends ExtendSelf3 causes an instantiation loop. | ||
// | ||
// # 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