Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NF] Fix type matching of boxed binary ops.
- Loading branch information
Showing
5 changed files
with
72 additions
and
6 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
46 changes: 46 additions & 0 deletions
46
testsuite/flattening/modelica/scodeinst/FunctionalArgBinary1.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,46 @@ | ||
// name: FunctionalArgBinary1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
partial function F | ||
input Real x; | ||
output Real y; | ||
end F; | ||
|
||
function f1 | ||
input F f; | ||
input Real x; | ||
output Real y; | ||
algorithm | ||
y := f(x) + f(x); | ||
end f1; | ||
|
||
function f2 | ||
input Real x; | ||
output Real y = x * 2; | ||
end f2; | ||
|
||
model FunctionalArgBinary1 | ||
Real x = f1(f2, 1); | ||
end FunctionalArgBinary1; | ||
|
||
// Result: | ||
// function f1 | ||
// input f<function>(#Real x) => #Real f; | ||
// input Real x; | ||
// output Real y; | ||
// algorithm | ||
// y := unbox(f(#(x))) + unbox(f(#(x))); | ||
// end f1; | ||
// | ||
// function f2 | ||
// input Real x; | ||
// output Real y = x * 2.0; | ||
// end f2; | ||
// | ||
// class FunctionalArgBinary1 | ||
// Real x = f1(f2, 1.0); | ||
// end FunctionalArgBinary1; | ||
// 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