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
12cc9eb
commit 15a59b0
Showing
6 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
flattening/modelica/declarations/DoubleClassDeclaration1.mo
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: DoubleClassDeclaration1.mo | ||
// status: incorrect | ||
// | ||
// Checks that duplicate top-level classes are detected. | ||
// | ||
|
||
model M | ||
end M; | ||
|
||
model M | ||
end M; | ||
|
||
// Result: | ||
// Error processing file: DoubleClassDeclaration1.mo | ||
// [flattening/modelica/declarations/DoubleClassDeclaration1.mo:7:1-8:6:writable] Notification: From here: | ||
// [flattening/modelica/declarations/DoubleClassDeclaration1.mo:10:1-11:6:writable] Error: An element with name M is already declared in this scope. | ||
// Error: Error occurred while flattening model M | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
29 changes: 29 additions & 0 deletions
29
flattening/modelica/declarations/DoubleClassDeclaration2.mo
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: DoubleClassDeclaration2.mo | ||
// status: incorrect | ||
// | ||
// Checks that duplicate classes are detected. | ||
// | ||
|
||
model M | ||
model A | ||
Real x; | ||
end A; | ||
|
||
model A | ||
Real y; | ||
end A; | ||
|
||
A a; | ||
end M; | ||
|
||
// Result: | ||
// Error processing file: DoubleClassDeclaration2.mo | ||
// [flattening/modelica/declarations/DoubleClassDeclaration2.mo:8:3-10:8:writable] Notification: From here: | ||
// [flattening/modelica/declarations/DoubleClassDeclaration2.mo:12:3-14:8:writable] Error: An element with name A is already declared in this scope. | ||
// Error: Error occurred while flattening model M | ||
// | ||
// # 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,31 @@ | ||
// name: DoubleFuncDeclaration.mo | ||
// status: incorrect | ||
// | ||
// Checks that duplicate functions are detected. | ||
// | ||
|
||
model DoubleFuncDeclaration | ||
function f | ||
input Real x; | ||
output Real y = x; | ||
end f; | ||
|
||
function f | ||
input String x; | ||
output String y = x; | ||
end f; | ||
|
||
Real x = f(1.0); | ||
end DoubleFuncDeclaration; | ||
|
||
// Result: | ||
// Error processing file: DoubleFuncDeclaration.mo | ||
// [flattening/modelica/declarations/DoubleFuncDeclaration.mo:8:3-11:8:writable] Notification: From here: | ||
// [flattening/modelica/declarations/DoubleFuncDeclaration.mo:13:3-16:8:writable] Error: An element with name f is already declared in this scope. | ||
// Error: Error occurred while flattening model DoubleFuncDeclaration | ||
// | ||
// # 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
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