-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve handling of inherited inner/outer elements (#10675)
- Use the instance parent as the start scope when looking for inner elements. - Change InstNode.instanceParent to resolve derived nodes before looking up the parent, not after.
- Loading branch information
Showing
6 changed files
with
76 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// name: InnerOuter11 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
partial function A | ||
input Real x; | ||
output Real y; | ||
end A; | ||
|
||
partial model M1 | ||
outer function f = A; | ||
end M1; | ||
|
||
model M2 | ||
extends M1; | ||
Real x = f(time); | ||
end M2; | ||
|
||
partial model M3 | ||
M2 m2; | ||
end M3; | ||
|
||
partial model M4 | ||
extends M3; | ||
end M4; | ||
|
||
model M5 | ||
extends M4; | ||
end M5; | ||
|
||
model InnerOuter11 | ||
function B | ||
input Real x; | ||
output Real y = x; | ||
end B; | ||
inner function f = B; | ||
M5 m; | ||
end InnerOuter11; | ||
|
||
// Result: | ||
// function InnerOuter11.f | ||
// input Real x; | ||
// output Real y = x; | ||
// end InnerOuter11.f; | ||
// | ||
// class InnerOuter11 | ||
// Real m.m2.x = InnerOuter11.f(time); | ||
// end InnerOuter11; | ||
// 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