Opened 13 years ago

Closed 12 years ago

Last modified 7 years ago

#1759 closed defect (fixed)

Erroneous warning in function

Reported by: Martin Sjölund Owned by: somebody
Priority: high Milestone: 1.9.4
Component: Frontend Version: trunk
Keywords: Cc:

Description

model M
  function f
    input Real r;
    output Real o := x;
  protected
    Real x := r;
    Real y(start=c);
  algorithm
    o := r;
    o := x;
    o := c;
  end f;
  Real r = sin(time), x = f(time);
  constant Real c = 3.4;
end M;

Error-message:

[a.mo:14:3-14:24:writable] Warning: Invalid public variable c, function variables that are not input/output must be protected.

Which is obviously wrong (c is not part of a function).

Change History (4)

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

Milestone: Future

comment:2 by Martin Sjölund, 12 years ago

Resolution: fixed
Status: newclosed

comment:3 by Dietmar Winkler, 9 years ago

Milestone: Futurepre1.9.4

It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.

comment:4 by Martin Sjölund, 7 years ago

Milestone: pre1.9.41.9.4

Removing the pre1.9.4 milestone in favor of 1.9.4.

Note: See TracTickets for help on using tickets.