Opened 11 years ago

Closed 9 years ago

Last modified 9 years ago

#2349 closed defect (fixed)

Type coercion gives (ignored) duplicated modification error

Reported by: Henrik Tidefelt Owned by: somebody
Priority: normal Milestone: 1.9.4
Component: Frontend Version: trunk
Keywords: Cc:

Description

The following model is inspired by a problem with the MSL example Modelica.Electrical.Machines.Examples.AsynchronousInductionMachines.AIMS_Start:

package DuplicateModification2
  record A "Compare Modelica.Electrical.Machines.Losses.CoreParameters"
    parameter Real y "VRef";
  end A;
  model B1 "Compare Modelica.Electrical.Machines.Utilities.ParameterRecords.AIM_SlipRingData"
    parameter A a(y = 0) "rotorCoreParameters";
  end B1;
  model B2 "Compare Modelica.Electrical.Machines.BasicMachines.AsynchronousInductionMachines.AIM_SlipRing"
    parameter A a(y = 0) "rotorCoreParameters";
  end B2;
  model C "Compare Modelica.Electrical.Machines.Examples.AsynchronousInductionMachines.AIMS_Start"
    B2 b(a = b0.a) "aims";
    parameter B1 b0 "aimsData";
  end C;
end DuplicateModification2;

Checking the model both gives an error and succeeds at the same time:

Check of DuplicateModification2.C completed successfully.

[C:/Documents and Settings/henrikt/My Documents/Models/Bugs/DuplicateModification2.mo:9:5-9:47:writable] Error: Variable b.a: Flera modifikationer av element = (typed)0 DAE.PROP(Integer, C_CONST), value: 0 and = (typed)0.0 DAE.PROP(Real, C_CONST), value: 0.0 i komponent y.

Class DuplicateModification2.C has 0 equation(s) and 0 variable(s).
0 of these are trivial equation(s).

The error goes away if 0.0 is used instead of 0 in the parameter modification inside class B2. It also goes away if the class restriction for A is changed from record to model.

Change History (7)

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

Milestone: 1.9.01.9.1

Postponed until 1.9.1

comment:2 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:3 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:4 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:5 by Per Östlund, 9 years ago

Resolution: fixed
Status: newclosed

Fixed in 96a1c78.

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

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:7 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.