Opened 4 years ago

Last modified 4 years ago

#6149 new defect

The NF accepts illegal type declarations?

Reported by: casella Owned by: perost
Priority: blocker Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Please consider the following test model

model TestComplex
  type ComplexPU = Complex(re(final unit = "1"), im(final unit = "1"));
  constant ComplexPU j = Complex(0,1);
end TestComplex;

OMC accepts it and compiles it, while Dymola complains that

A type may only inherit from the same kind of specialized class,
but ComplexPU inherited from record Complex.

and only accepts the model if I replace type with operator record. I couldn't find the place in the specification that explains what you can put in type declarations, but I guess OMC is too lax here.

Change History (2)

comment:1 Changed 4 years ago by perost

It's defined in 7.1.3. And yes, the NF doesn't check that yet, nor does it check all the rules for what the specialized classes are allowed to contain.

comment:2 Changed 4 years ago by casella

  • Milestone changed from 1.17.0 to 2.0.0
  • Priority changed from high to blocker

OK, then I'll tentatively mark this as a blocker for 2.0.0.

This is quite bad, because you write models that work, and then they are rigtfully refused by other tools.

Maybe we should open a ticket about the more general issue?

Note: See TracTickets for help on using tickets.