Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Try to inline operator record constructors instead of evaluating them when trying to split them during flattening.
- Loading branch information
Showing
4 changed files
with
97 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// name: Inline2 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
operator record Complex | ||
Real re, im; | ||
|
||
encapsulated operator 'constructor' | ||
function fromReal | ||
import Complex; | ||
input Real re; | ||
input Real im = 0.0; | ||
output Complex result(re = re, im = im); | ||
algorithm | ||
end fromReal; | ||
end 'constructor'; | ||
end Complex; | ||
|
||
model Inline2 | ||
parameter Real a = 1; | ||
parameter Real b = 2; | ||
final parameter Complex c = Complex(a, b); | ||
end Inline2; | ||
|
||
// Result: | ||
// class Inline2 | ||
// parameter Real a = 1.0; | ||
// parameter Real b = 2.0; | ||
// final parameter Real c.re = a; | ||
// final parameter Real c.im = b; | ||
// end Inline2; | ||
// 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