Opened 16 years ago

Closed 9 years ago

Last modified 9 years ago

#1078 closed defect (fixed)

Improve error message when trying to override a final parameter/variable (from MathCore)

Reported by: krsta Owned by: Martin Sjölund
Priority: high Milestone: 1.9.4
Component: Frontend Version:
Keywords: Cc: krsta, Martin Sjölund

Description

Here is a simple model where an illegal modification of a (final) unit is performed. The error message is not clear what to do. It should at least mention which parameter/variable that is modified, i.e., "unit" in this case.

model Test
   parameter Modelica.SIunits.Distance di(unit="m")=0.125 "Inner pipe diameter";
end Test;

Error message:

[:2:4-2:80:readonly]: Variable di: trying to override final variable in class: Real
[:2:4-2:80:readonly]: Variable di: Error occured while flattening model Test

Change History (13)

comment:2 by Martin Sjölund, 14 years ago

Trunk now says

{{{[b.mo:2:4-2:80:writable] Error: Variable di: trying to override final variable in class: Real

by using modifiers: di( = "m", = final "m") that do not agree.}}}

I'm assuming this was the desired error message

comment:3 by Henrik Tidefelt, 11 years ago

Cc: krsta, → krsta
Component: Backend
Resolution: fixed
Status: closedreopened

Reopening, as there is currently no error message at all.

comment:4 by Lennart Ochel, 10 years ago

Cc: Martin Sjölund added

Should that be treated in the front end?

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

Component: BackendFrontend
Milestone: 1.9.1
Owner: changed from krsta to Per Östlund
Status: reopenedassigned

Simpler model:

model Test
   type Distance = Real(final unit="m");
   parameter Distance di(unit="mm")=0.125;
end Test;

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

Milestone: 1.9.11.9.2

This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).

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

Milestone: 1.9.21.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

comment:8 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:9 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

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

Owner: changed from Per Östlund to Martin Sjölund
Status: assignedaccepted

comment:11 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.9.4
Resolution: fixed
Status: acceptedclosed

This was fixed in the 1.9.4 release.

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

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:13 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.