Opened 14 years ago

Last modified 14 years ago

#1431 closed defect (fixed)

Better error message for equation sections in functions needed

Reported by: Per Östlund Owned by: Per Östlund
Priority: high Milestone:
Component: Version:
Keywords: Cc: Per Östlund,

Description

Equation sections should give an error that says that equations sections are not allowed inside functions. Currently we say that equations failed to instantiate, i.e. for this model:

function f
  output Real x;
equation
  x = 42;
end f;

model m
  Real r = f();
end m;

we get the error message:

[model2.mo:4:3-4:8:writable] Error: Failed to instantiate equation x = 4;

Change History (1)

comment:1 by Martin Sjölund, 14 years ago

Fixed in trunk

Note: See TracTickets for help on using tickets.