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
6b50eb6
commit ee38431
Showing
9 changed files
with
169 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// name: inst5.mo | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// Check that instances are cloned properly, so that modifiers don't "stick" to | ||
// a class. | ||
// | ||
|
||
model A | ||
Real x; | ||
end A; | ||
|
||
model B | ||
A a1(x = 3); | ||
A a2; | ||
A a3(x = 5); | ||
end B; | ||
|
||
// Result: | ||
// class B | ||
// Real a1.x = 3; | ||
// Real a2.x; | ||
// Real a3.x = 5; | ||
// end B; | ||
// 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,30 @@ | ||
// name: lookup1.mo | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model A | ||
model B | ||
model C | ||
Real x; | ||
end C; | ||
end B; | ||
|
||
B b; | ||
end A; | ||
|
||
model M | ||
A a; | ||
a.B b; | ||
end M; | ||
|
||
// Result: | ||
// Error processing file: lookup1.mo | ||
// [flattening/modelica/scodeinst/lookup1.mo:19:3-19:8:writable] Error: Class name 'a.B' was found via a component (only component and function call names may be accessed in this way). | ||
// | ||
// # 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,30 @@ | ||
// name: lookup2.mo | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model A | ||
model B | ||
model C | ||
Real x; | ||
end C; | ||
end B; | ||
|
||
B b; | ||
end A; | ||
|
||
model M | ||
A a; | ||
A.b.C c; | ||
end M; | ||
|
||
// Result: | ||
// Error processing file: lookup2.mo | ||
// [flattening/modelica/scodeinst/lookup2.mo:19:3-19:10:writable] Error: Class name 'A.b.C' was found via a component (only component and function call names may be accessed in this way). | ||
// | ||
// # 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,34 @@ | ||
// name: lookup3.mo | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model A | ||
model B | ||
model C | ||
model D | ||
Real x; | ||
end D; | ||
|
||
D d; | ||
end C; | ||
end B; | ||
|
||
B b; | ||
end A; | ||
|
||
model M | ||
A a; | ||
Real x = a.B.C; | ||
end M; | ||
|
||
// Result: | ||
// Error processing file: lookup3.mo | ||
// [flattening/modelica/scodeinst/lookup3.mo:23:3-23:17:writable] Error: Class name 'a.B.C' was found via a component (only component and function call names may be accessed in this way). | ||
// | ||
// # 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,34 @@ | ||
// name: lookup4.mo | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model A | ||
model B | ||
model C | ||
model D | ||
Real x; | ||
end D; | ||
|
||
D d; | ||
end C; | ||
end B; | ||
|
||
B b; | ||
end A; | ||
|
||
model M | ||
A a; | ||
Real x = a.b.C.d.x; | ||
end M; | ||
|
||
// Result: | ||
// Error processing file: lookup4.mo | ||
// [flattening/modelica/scodeinst/lookup4.mo:23:3-23:21:writable] Error: Found class C during lookup of composite component name 'a.b.C.d.x', expected component. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |