Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added and reactivated new inst test cases.
- Loading branch information
1 parent
ef666ab
commit dcfd6aa
Showing
7 changed files
with
127 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// name: extends3.mo | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// Checks that inherited components are not instantiated in the scope they're | ||
// inherited into. | ||
// | ||
|
||
model A | ||
C c; | ||
end A; | ||
|
||
model B | ||
model C | ||
Real x; | ||
end C; | ||
|
||
extends A; | ||
end B; | ||
|
||
// Result: | ||
// Error processing file: extends3.mo | ||
// [flattening/modelica/scodeinst/extends3.mo:11:3-11:6:writable] Error: Class C not found in scope <unknown>. | ||
// | ||
// # 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 |
---|---|---|
|
@@ -10,6 +10,7 @@ model M | |
MyReal x; | ||
Real y(start = 1.0); | ||
end M; | ||
|
||
// Result: | ||
// class M | ||
// Real x(start = 1.0); | ||
|
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: usertype3.mo | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
type MyReal = Real; | ||
|
||
model M | ||
MyReal x; | ||
MyReal y(start = 1.0); | ||
MyReal z(start = 2.0); | ||
end M; | ||
|
||
// Result: | ||
// class M | ||
// Real x; | ||
// Real y(start = 1.0); | ||
// Real z(start = 2.0); | ||
// end M; | ||
// 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,23 @@ | ||
// name: usertype4.mo | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
type MyReal = Real; | ||
type MyReal2 = MyReal(start = 3.0); | ||
type MyReal3 = MyReal2(start = 4.0); | ||
|
||
model M | ||
MyReal x; | ||
MyReal2 y; | ||
MyReal3 z; | ||
end M; | ||
|
||
// Result: | ||
// class M | ||
// Real x; | ||
// Real y(start = 3.0); | ||
// Real z(start = 4.0); | ||
// end M; | ||
// 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,19 @@ | ||
// name: usertype5.mo | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
model MyReal | ||
extends Real; | ||
end MyReal; | ||
|
||
model M | ||
MyReal x; | ||
end M; | ||
|
||
// Result: | ||
// class M | ||
// Real x; | ||
// end M; | ||
// 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,24 @@ | ||
// name: usertype6.mo | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model MyReal | ||
extends Real; | ||
Real y; | ||
end MyReal; | ||
|
||
model M | ||
MyReal x; | ||
end M; | ||
|
||
// Result: | ||
// Error processing file: usertype6.mo | ||
// [flattening/modelica/scodeinst/usertype6.mo:8:3-8:15:writable] Error: A class extending from builtin type Real may not have other elements. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |