Opened 11 years ago

Closed 11 years ago

#2401 closed defect (fixed)

Parser accepts wrong model

Reported by: Adrian Pop Owned by: Martin Sjölund
Priority: high Milestone: 1.9.1
Component: Parser Version: trunk
Keywords: Cc:

Description

The model which is accepted is:

package ArrayModification
  partial function fpartial
    input Real x;
    output Real y;
  end fpartial;

  model X
    parameter Real k = 1;
    replaceable function f = fpartial;
    parameter Real x = f(k);
  end X;

  function f1
    input Real x;
    output Real y;
  algorithm 
    y :=x;
  end f1;

  function f2
    input Real x;
    output Real y;
  algorithm 
    y :=x + 1;
  end f2;

  model Y
    X x[2](f = {function f1(x = 1), function f2(x = 2)});
  end Y;

end ArrayModification;

class modification have only arguments which do not contain function prefix. function prefix should only be accepted in function calls.

Change History (2)

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

Milestone: 1.9.01.9.1

Postponed until 1.9.1

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

Resolution: fixed
Status: newclosed

Note that the above model is allowed because the array constructor is a function call. r18517 fixes the issue and adds a parsing test that checks for the error.

Note: See TracTickets for help on using tickets.