Opened 12 years ago

Last modified 4 years ago

#2193 closed defect

omc accepts undefined identifiers in structural varying models — at Initial Version

Reported by: Christoph Höger Owned by: somebody
Priority: high Milestone: 1.16.0
Component: New Instantiation Version: trunk
Keywords: Cc:

Description

model IfExpression
  parameter Boolean b = true;
  Integer i = if not b then c else 1;
equation
  assert(i == 1, "The value of i must be 1");
end IfExpression;

The above model should fail (and there should be a testcase to catch that error).

See: https://trac.modelica.org/Modelica/ticket/1101#comment:5
I suppose it is because of some inlining/constant folding, as the result looks like this:

class IfExpression
  parameter Boolean b = true;
  Integer i = 1;
equation
  assert(i == 1,"The value of i must be 1");
end IfExpression;

omc should certainly do typechecking _before_ evaluation ;).

Change History (0)

Note: See TracTickets for help on using tickets.