﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4786	Functions are sometimes not type checked when passed as arguments	Per Östlund	Martin Sjölund	"This code should produce an error message, but currently compiles:
{{{#!mo
function f
  input Integer i;
  input FuncT func;
  
  partial function FuncT
    input String s;
  end FuncT;
algorithm
  func(String(i));
end f;

function wrongType
  input Integer i;
  input Integer i2 = 1;
algorithm
  print(String(i) + ""\n"");
  print(String(i2) + ""\n"");
end wrongType;

function test
algorithm
  f(1, wrongType);
end test;
}}}
The function signature of {{{wrongType}}} doesn't match what {{{f}}} expects at all, but it seems this isn't checked. The default argument also doesn't seem to be used, and when I run the script it prints a random number for {{{i}}} and 0 for {{{i2}}}. This is pretty bad since it's easy to write code that looks (and should be) correct, but which gives undefined behaviour. The same thing happens when using function partial application instead of just passing the argument as it is."	defect	closed	blocker	1.13.0	Frontend	v1.13.0-dev-nightly	fixed		
