﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3203	Lookup fails for partial function application and component modifier redeclare	Henrik Tidefelt	Per Östlund	"Validate `TestFailing` in the package below:
{{{
package ComponentModRedeclare
  partial function funcBase
    output Real y;
  end funcBase;

  function funcDerived
    extends funcBase;
    input Real x;
  algorithm
    y := x;
  end funcDerived;

  partial model Base
    replaceable function foo = funcBase;
  end Base;

  model Derived
    extends Base;
    Real y;
  equation
    y = foo();
  end Derived;

  model TestWorking
    Derived derived(redeclare function foo = funcDerived(x = 1));
    Real notConstant(start = 1);
  equation
    der(notConstant) = -notConstant;
  end TestWorking;

  model TestFailing
    Derived derived(redeclare function foo = funcDerived(x = notConstant));
    Real notConstant(start = 1);
  equation
    der(notConstant) = -notConstant;
  end TestFailing;
end ComponentModRedeclare;
}}}

This results in
{{{
[ComponentModRedeclare:39:58-39:76:writable] Error: Variable notConstant not found in scope ComponentModRedeclare.Derived$derived.
[ComponentModRedeclare:28:5-28:16:writable] Error: Class foo not found in scope ComponentModRedeclare.Derived$derived (looking for a function or record).
Error: Error occurred while flattening model ComponentModRedeclare.TestFailing
}}}
whereas the model `TestWorking` validates fine.

The only difference between `TestFailing` and `TestWorking` is the variability of the expression used in the modification for `x`."	defect	closed	blocker	2.0.0	New Instantiation	trunk	fixed		
