﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3467	Problems with type redeclaration in complex numbers	Francesco Casella	Per Östlund	"Please consider the following code fragment
{{{
package TestComplex
  package Types
    operator record ComplexVoltage = 
      Complex(redeclare Modelica.SIunits.Voltage re, 
              redeclare Modelica.SIunits.Voltage im);
    operator record ComplexCurrent = 
      Complex(redeclare Modelica.SIunits.Current re,
              redeclare Modelica.SIunits.Current im);
    operator record Impedance = 
      Complex(redeclare Modelica.SIunits.Resistance re,
              redeclare Modelica.SIunits.Resistance im);
  end Types;

  package Test
    model A
      import SI = Modelica.SIunits;
      parameter SI.Resistance R = 1;
      parameter SI.Reactance X = 1;
      parameter Types.Impedance Z = Complex(R, X);
      Types.ComplexCurrent I = Complex(1, 0);
      Types.ComplexVoltage V = Z * I;
    end A;
  end Test;
  annotation(uses(Complex(version = ""3.2.1""), Modelica(version = ""3.2.1"")));
end TestComplex;
}}}

When compiling this, the current nightly complains that:
{{{
[1] 02:36:24 Translation Error
[TestComplex: 21:7-21:45]: Variable I: Duplicate modification of element
(redeclare .Modelica.SIunits.Current re) and  = (typed)1.0 DAE.PROP(Real, C_CONST), value: 1.0 on component re.

[2] 02:36:24 Translation Error
[TestComplex: 21:7-21:45]: Variable I: Duplicate modification of element
 (redeclare .Modelica.SIunits.Current im) and  = (typed)0.0 DAE.PROP(Real, C_CONST), value: 0.0 on component im.
}}}

plus other similar errors, but then it  happily proceeds and produces correct results.

- What do these error messages mean?
- Why is correct simulation code produced after an error (not a warning)?"	defect	closed	high	1.9.4	Frontend		fixed		andrea.bartolini@…
