Opened 16 years ago

Last modified 14 years ago

#1042 closed defect (fixed)

Inheriting multiple definitions with different type should not work (from MathCore)

Reported by: krsta Owned by: krsta
Priority: high Milestone:
Component: Version:
Keywords: Cc: krsta,

Description

The ErrorColor contains a multiple declaration of the red instance. Since they are of different types it should be illegal and not simulate.

record ColorData
  parameter Real red = 2;
  parameter Real blue = 6;
  Real   green;
end ColorData;

class ErrorColor
  extends ColorData;
  parameter Real blue=6;
  parameter Integer red=2;
equation 
  red + blue + green=10;
end ErrorColor;

Change History (4)

comment:2 Changed 14 years ago by sjoelund.se

Was fixed in trunk.

comment:3 Changed 14 years ago by petar

I could not find a testcase. What is not tested is not implemented!

comment:4 Changed 14 years ago by sjoelund.se

You are not looking hard enough:
{{{$ grep "Error: Duplicate elements (due to inherited elements)" ~/dev/trunk/testsuite/mofiles/*.mo | cut -d: -f1 | uniq
/home/marsj/dev/trunk/testsuite/mofiles/DisturbedResistance3.mo
/home/marsj/dev/trunk/testsuite/mofiles/DisturbedResistance4.mo
/home/marsj/dev/trunk/testsuite/mofiles/DoubleDeclaration.mo
/home/marsj/dev/trunk/testsuite/mofiles/DuplicateElementsExtends.mo
/home/marsj/dev/trunk/testsuite/mofiles/DuplicateElements.mo
/home/marsj/dev/trunk/testsuite/mofiles/DuplicateElementsNonEquivalent.mo
/home/marsj/dev/trunk/testsuite/mofiles/MultipleDeclarations.mo}}}

Note: See TracTickets for help on using tickets.