Opened 10 years ago

Closed 3 years ago

#2846 closed defect (fixed)

Bad handling of local derived function with input names the same as modifiers

Reported by: Adrian Pop Owned by: somebody
Priority: high Milestone: 1.19.0
Component: New Instantiation Version: trunk
Keywords: Cc:

Description

Flattening this model:

model X
  parameter Real x = 1;
  parameter Real y = 2;
  
  function f = derivedFunction(x = x, y = y);
  
  function derivedFunction
    input Real a;
    input Real x;
    input Real y;
    output Real z;
  algorithm
     z := x + y + a;
  end derivedFunction;
  
  parameter Real u = f(3);
end X;

will get you the desired result via dll compilation but also an error message from function interpretation:

[LocalFunction.mo:5:3-5:45:writable] Error: Cyclically dependent constants or parameters found in scope : {x}, {y}.

I think this should be fixed by using the evaluated parameter values as bindings in function and not the actual parameter names. Any other ideas?
Is not really the same scope for the x and y we sent in.

Change History (1)

comment:1 by Per Östlund, 3 years ago

Component: FrontendNew Instantiation
Milestone: Future1.19.0
Resolution: fixed
Status: newclosed

Fixed in 517b9a7b.

Note: See TracTickets for help on using tickets.