Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix dimension typing regression (#12136)
- Be conservative when typing dimensions of function output parameters and assume that any binding that contains component references might be unsafe to evaluate.
- Loading branch information
Showing
3 changed files
with
38 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
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,26 @@ | ||
// name: DimUnknown15 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
function f | ||
input Real x[:] = {1, 2, 3}; | ||
output Real y[:] = x; | ||
end f; | ||
|
||
model DimUnknown15 | ||
Real x[:] = f({1, 2, 3, 4}); | ||
end DimUnknown15; | ||
|
||
// Result: | ||
// class DimUnknown15 | ||
// Real x[1]; | ||
// Real x[2]; | ||
// Real x[3]; | ||
// Real x[4]; | ||
// equation | ||
// x = {1.0, 2.0, 3.0, 4.0}; | ||
// end DimUnknown15; | ||
// 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