﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1310	Error messages when calling functions with too few arguments	Martin Sjölund	Martin Sjölund	"{{{public function unparseStr
""function: unparseStr
  Prettyprints the Program, i.e. the whole AST, to a string.""
  input Absyn.Program inProgram;
  input Boolean inBoolean;
  output String outString;
algorithm
  ...
end unparseStr;}}}

{{{Dump.unparseStr(prog);}}}

{{{Gives error: Expected boolean scalar, got:TYPE[0] -> NONE}}}

This error comes from dynamically loading the function. It should come much sooner (say, in elabCall). It is correct that it is an error though; I forgot the second argument.

Other examples that give weird output:
{{{package P
function fn
  input Integer i;
  output String s;
algorithm
  s := String(i);
end fn;

function f0
  output String s;
algorithm
  s := fn();
end f0;
function f1
  output String s;
algorithm
  s := fn(1);
end f1;
function f2
  output String s;
algorithm
  s := fn(1,2);
end f2;

end P;}}}

{{{""0"" // It elaborates the call and tries to read input even though there is none...
""""
""1""
""""
instantiateDaeFunction failed for P.f2 in scope: <global scope>

""Error: No matching function found for P.f2() of type function() => String in component <NO COMPONENT>, candidates are function() => String
""}}}"	defect	closed	high				fixed		Martin Sjölund
