﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2348	Duplicate modification error treated as warning	Henrik Tidefelt	Adrian Pop	"The model below is inspired by problems with the MSL example `Modelica.Electrical.Machines.Examples.AsynchronousInductionMachines.AIMS_Start`:
{{{
package DuplicateModification
  record A ""Compare Modelica.Electrical.Machines.Losses.CoreParameters""
    parameter Integer x ""m"";
  end A;
  class B1 ""Compare Modelica.Electrical.Machines.Utilities.ParameterRecords.AIM_SlipRingData""
    parameter A a(x = 1) ""rotorCoreParameters"";
  end B1;
  class B2 ""Compare Modelica.Electrical.Machines.BasicMachines.AsynchronousInductionMachines.AIM_SlipRing""
    parameter A a(final x = 1) ""rotorCoreParameters"";
  end B2;
  class C ""Compare Modelica.Electrical.Machines.Examples.AsynchronousInductionMachines.AIMS_Start""
    B2 b(a = b0.a) ""aims"";
    parameter B1 b0 ""aimsData"";
  end C;
end DuplicateModification;
}}}

Checking the class `C` both gives an error and succeeds at the same time:
  Check of DuplicateModification.C completed successfully.

  [C:/Documents and Settings/henrikt/My Documents/Models/Bugs/DuplicateModification.mo:9:5-9:53:writable] Error: Variable b.a: Flera modifikationer av element final  = (typed)1 DAE.PROP(Integer, C_CONST), value: 1 and  = (typed)1 DAE.PROP(Integer, C_CONST), value: 1 i komponent x.

  Class DuplicateModification.C has 0 equation(s) and 0 variable(s).
  0 of these are trivial equation(s).

It is even possible to simulate the model, so the presence of the error message is very confusing.

Some additional details:
1.  Changing the class restriction of `A` to `model` removes the error message.
2.  As far as I can see, the error message is **correct** according to the language specification (3.3), page 71, 7.2.3 'Merging of Modifications':

  Merging of modifiers means that outer modifiers override inner modifiers. The merging is hierarchical, and a value for an entire non-simple overrides value modifiers for all components, and it is an error if this overrides a final prefix for a component."	defect	closed	normal	1.9.4	Frontend	trunk	fixed		
