Opened 15 years ago

Closed 4 years ago

Last modified 4 years ago

#1174 closed defect (fixed)

Check model reports errors for correct models and vice versa.

Reported by: dhedberg Owned by: dhedberg
Priority: high Milestone: 1.16.0
Component: Frontend Version:
Keywords: Cc: Per Östlund

Description

The kernel fails to recognize the modification of x in the extends clause in model B, resulting in an error that A.x is not identical to B.x when checking model B.

model A
  Integer x;
end A;

model B
  extends A(x=2);
  Integer x=2;
end B;

Kernel reports the following error:
Check of B failed
Error: Duplicate elements (due to inherited elements) not identical, first element is: Integer x = 2; from baseclass: <nothing>
, second element is: Integer x;
from baseclass: A

Error: Error occured while flattening model B

The error itself could be re-structured with line breaks etc, also the comment " from baseclass: <nothing>" could be improved. The element is locally declared and not inherited at all.

For the same reason the kernel incorrectly reports the erronous model B below as correct when checking it:

model A
  Integer x=2;
end A;

model B
  extends A(x=3);
  Integer x=2;
end B;

Change History (6)

comment:1 by dhedberg, 15 years ago

The corresponding ticket in MathCore Track is 1944.

comment:2 by Adrian Pop, 15 years ago

Similar to almost duplicate of [BUG:1126].

comment:3 by Martin Sjölund, 10 years ago

Cc: Per Östlund added; dhedberg removed
Component: Frontend

comment:4 by Dietmar Winkler, 9 years ago

Milestone: Future

comment:5 by Per Östlund, 4 years ago

Resolution: fixed
Status: newclosed

The new frontend handles this correctly.

comment:6 by Francesco Casella, 4 years ago

Milestone: Future1.16.0
Note: See TracTickets for help on using tickets.