Opened 6 years ago

Last modified 6 years ago

#6149 new defect

The NF accepts illegal type declarations?

Reported by: Francesco Casella Owned by: Per Östlund
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 by Per Östlund, 6 years ago

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 by Francesco Casella, 6 years ago

Milestone: 1.17.0 → 2.0.0
Priority: high → 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.