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#2003 - OpenModelica/OpenModelica-testsuite#775
- Loading branch information
1 parent
3852898
commit 1514b59
Showing
11 changed files
with
189 additions
and
41 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,29 @@ | ||
// name: BuiltinAttribute1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
model BuiltinAttribute1 | ||
Real r(quantity = "m", unit = "kg", displayUnit = "kg", | ||
min = -100, max = 100, start = 10, fixed = true, nominal = 1, | ||
unbounded = true, stateSelect = StateSelect.never); | ||
|
||
Integer i(quantity = "m", min = -100, max = 100, start = 10, fixed = true); | ||
Boolean b(quantity = "m", start = false, fixed = true); | ||
String s(quantity = "m", start = "hello", fixed = true); | ||
|
||
type E = enumeration(one, two, three); | ||
E e(quantity = "m", min = E.two, max = E.three, start = E.two, fixed = false); | ||
end BuiltinAttribute1; | ||
|
||
|
||
// Result: | ||
// class BuiltinAttribute1 | ||
// Real r(quantity = "m", unit = "kg", displayUnit = "kg", min = -100.0, max = 100.0, start = 10.0, fixed = true, nominal = 1.0, stateSelect = StateSelect.never); | ||
// Integer i(quantity = "m", min = -100, max = 100, start = 10, fixed = true); | ||
// Boolean b(quantity = "m", start = false, fixed = true); | ||
// String s(quantity = "m", start = "hello"); | ||
// enumeration(one, two, three) e(quantity = "m", min = E.two, max = E.three, start = E.two, fixed = false); | ||
// end BuiltinAttribute1; | ||
// 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,19 @@ | ||
// name: BuiltinAttribute3 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model BuiltinAttribute3 | ||
Real x(start(y = 1)); | ||
end BuiltinAttribute3; | ||
|
||
// Result: | ||
// Error processing file: BuiltinAttribute3.mo | ||
// [flattening/modelica/scodeinst/BuiltinAttribute3.mo:8:10-8:22:writable] Error: Modified element start.y not found in class Real. | ||
// | ||
// # 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,19 @@ | ||
// name: BuiltinAttribute4 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model BuiltinAttribute4 | ||
Real x(x = 1); | ||
end BuiltinAttribute4; | ||
|
||
// Result: | ||
// Error processing file: BuiltinAttribute4.mo | ||
// [flattening/modelica/scodeinst/BuiltinAttribute4.mo:8:10-8:15:writable] Error: Modified element x not found in class Real. | ||
// | ||
// # 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,19 @@ | ||
// name: BuiltinAttribute5 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model BuiltinAttribute5 | ||
Real x(start = "fish"); | ||
end BuiltinAttribute5; | ||
|
||
// Result: | ||
// Error processing file: BuiltinAttribute5.mo | ||
// [flattening/modelica/scodeinst/BuiltinAttribute5.mo:8:10-8:24:writable] Error: Type mismatch in binding start = "fish", expected subtype of Real, got type String. | ||
// | ||
// # 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,19 @@ | ||
// name: BuiltinAttribute6 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model BuiltinAttribute6 | ||
Real x(quantity = 1); | ||
end BuiltinAttribute6; | ||
|
||
// Result: | ||
// Error processing file: BuiltinAttribute6.mo | ||
// [flattening/modelica/scodeinst/BuiltinAttribute6.mo:8:10-8:22:writable] Error: Type mismatch in binding quantity = 1, expected subtype of String, got type Integer. | ||
// | ||
// # 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,19 @@ | ||
// name: BuiltinAttribute7 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model BuiltinAttribute7 | ||
Real x(redeclare Real start = 1.0); | ||
end BuiltinAttribute7; | ||
|
||
// Result: | ||
// Error processing file: BuiltinAttribute7.mo | ||
// [flattening/modelica/scodeinst/BuiltinAttribute7.mo:8:10-8:36:writable] Error: Invalid redeclaration of start, attributes of basic types may not be redeclared. | ||
// | ||
// # 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,25 @@ | ||
// name: BuiltinAttribute8 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
|
||
model A | ||
Real x(final start = 1.0); | ||
end A; | ||
|
||
model BuiltinAttribute8 | ||
extends A(x(start = 2.0)); | ||
end BuiltinAttribute8; | ||
|
||
// Result: | ||
// Error processing file: BuiltinAttribute8.mo | ||
// [flattening/modelica/scodeinst/BuiltinAttribute8.mo:13:15-13:26:writable] Notification: From here: | ||
// [flattening/modelica/scodeinst/BuiltinAttribute8.mo:9:16-9:27:writable] Error: Trying to override final element start with modifier '2.0'. | ||
// | ||
// # 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: BuiltinAttribute9 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
|
||
model BuiltinAttribute9 | ||
Real x; | ||
Real y(start = x); | ||
end BuiltinAttribute9; | ||
|
||
// Result: | ||
// Error processing file: BuiltinAttribute9.mo | ||
// [flattening/modelica/scodeinst/BuiltinAttribute9.mo:10:10-10:19:writable] Error: Component start of variability parameter has binding 'x' of higher variability continuous. | ||
// | ||
// # 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 was deleted.
Oops, something went wrong.