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#2317 - OpenModelica/OpenModelica-testsuite#898
- Loading branch information
1 parent
489a0c5
commit 21bec3c
Showing
3 changed files
with
70 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,25 @@ | ||
// name: ExtendsShort1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
package P | ||
constant Integer n = 2; | ||
|
||
model M | ||
Integer x = n; | ||
end M; | ||
end P; | ||
|
||
model ExtendsShort1 | ||
model M = P.M; | ||
M m; | ||
end ExtendsShort1; | ||
|
||
// Result: | ||
// class ExtendsShort1 | ||
// Integer m.x = 2; | ||
// end ExtendsShort1; | ||
// 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,43 @@ | ||
// name: ExtendsShort2 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
package P | ||
function f | ||
input Real x; | ||
output Real y; | ||
algorithm | ||
y := f2(x); | ||
end f; | ||
|
||
function f2 | ||
input Real x; | ||
output Real y = x * 2; | ||
end f2; | ||
end P; | ||
|
||
model ExtendsShort2 | ||
function f = P.f; | ||
Real x = f(2.0); | ||
end ExtendsShort2; | ||
|
||
// Result: | ||
// function P.f2 | ||
// input Real x; | ||
// output Real y = x * 2.0; | ||
// end P.f2; | ||
// | ||
// function f | ||
// input Real x; | ||
// output Real y; | ||
// algorithm | ||
// y := P.f2(x); | ||
// end f; | ||
// | ||
// class ExtendsShort2 | ||
// Real x = f(2.0); | ||
// end ExtendsShort2; | ||
// 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