﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1371	Protected function arguments cause confusing error message	Per Östlund	Per Östlund	"When instantiating a model such as this:
{{{
function fn
  protected Real r;
  input Real inR;
  output Real outR;
algorithm
  outR := inR;
end fn;

model test
  Real r, r2;
equation
  r = fn(r2);
end test;
}}}
the error message given is:
{{{
[protarg.mo:12:3-12:13:writable] Error: Failed to instantiate equation r = fn(r2);
}}}
The problem is that protected denotes a whole section and not a single variable, so the input and output parameters of the function is also protected. A protected input or output parameter doesn't really make much sense I think, but I can't see anything about it in the standard. We should probably print a warning either that you shouldn't protected input and output parameters, or an error that the number of arguments doesn't match the function definition."	defect	closed	normal		Instantiation	trunk	fixed		Per Östlund Martin Sjölund
