This repository has been archived by the owner on Apr 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Belonging to [master]: - OpenModelica/OMCompiler#2293 - #885
- Loading branch information
1 parent
79692b0
commit bf7ba0b
Showing
3 changed files
with
64 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,36 @@ | ||
// name: ClassExtends8 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
package P1 | ||
replaceable model M | ||
Real x; | ||
end M; | ||
end P1; | ||
|
||
package P2 | ||
extends P1; | ||
|
||
redeclare model extends M | ||
Real y; | ||
end M; | ||
end P2; | ||
|
||
model ClassExtends8 | ||
package PA = P2; | ||
package PB = P2; | ||
|
||
PA.M m1; | ||
PB.M m2; | ||
end ClassExtends8; | ||
|
||
// Result: | ||
// class ClassExtends8 | ||
// Real m1.x; | ||
// Real m1.y; | ||
// Real m2.x; | ||
// Real m2.y; | ||
// end ClassExtends8; | ||
// 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
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,26 @@ | ||
// name: RecursiveExtends3 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// Checks that the compiler catches recursive extends. | ||
// | ||
|
||
model A | ||
Real x; | ||
end A; | ||
|
||
model RecursiveExtends3 | ||
model A = A; | ||
A a; | ||
end RecursiveExtends3; | ||
|
||
// Result: | ||
// Error processing file: RecursiveExtends3.mo | ||
// [flattening/modelica/scodeinst/RecursiveExtends3.mo:14:3-14:14:writable] Error: Recursive short class definition of A in terms of A. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |