Opened 13 years ago
Closed 13 years ago
#1920 closed defect (fixed)
Add casts inside matrix constructor
| Reported by: | Martin Sjölund | Owned by: | Martin Sjölund |
|---|---|---|---|
| Priority: | high | Milestone: | 1.9.0 |
| Component: | Frontend | Version: | |
| Keywords: | Cc: |
Description
The following code flattens wrongly:
model M
function f
input Integer i[:];
input Real r[:];
output Real o[:,:];
algorithm
o := [i;r];
end f;
Real mat[:,:] = f({1,2,3},{4,5,6});
end M;
It becomes:
o := /*Real[:, 1]*/(cat(1, promote(i, 1), promote(r, 1)));
But should become:
o := (cat(1, /*Real[:, 1]*/ promote(i, 1), promote(r, 1)));
Change History (2)
comment:1 by , 13 years ago
| Component: | Backend → Frontend |
|---|---|
| Owner: | changed from to |
| Status: | new → accepted |
comment:2 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
Note:
See TracTickets
for help on using tickets.

Fixed for this case. There might be more, but elabMatrix needs to be rewritten to handle everything since it seems to be done in a way that is very hard to make a small fix.