Opened 12 years ago

Closed 7 years ago

#1790 closed defect (fixed)

Component redeclarations does not inherit array dimensions.

Reported by: dhedberg@… Owned by: Per Östlund
Priority: high Milestone: 1.13.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Redeclaring a component should inherit the original array dimensions (and array dimension sizes) of the original declaration if no array dimensions are specified in the redeclaration.

Given:

model M1
  replaceable Real r[3];
end M1;

model M2
  extends M1(redeclare Real r);
end M2;

instantiateModel(M1) and instantiateModel(M2) should produce the same result for r, but the array dimension is missing in M2.

instantiateModel(M1):

class M1
  Real r[1];
  Real r[2];
  Real r[3];
end M1;

instantiateModel(M2):

class M2
  Real r;
end M2;

Change History (4)

comment:1 by Martin Sjölund, 12 years ago

Milestone: 1.9.0Future
Owner: changed from somebody to Per Östlund
Status: newassigned

Works with the new instantiation, and will not work until then.

comment:2 by Francesco Casella, 7 years ago

Component: FrontendNew Instantiation

As of v1.13.0-dev-148-g3532b10, the "old" front end produces the correct result, while the "new" front end loses the dimension of r[3] again.

comment:3 by Francesco Casella, 7 years ago

Milestone: Future2.0.0

comment:4 by Francesco Casella, 7 years ago

Milestone: 2.0.01.13.0
Resolution: fixed
Status: assignedclosed

Now also the new front end behaves correctly. Since both front-ends wok fine, I am closing this ticket for 1.13.0

Note: See TracTickets for help on using tickets.