You are missing the return type in the lambda:
def Bind2(x: number): func(string): any
return (s): any => { # ": any" added here
return x
}
enddef
Perhaps it's a bit strange that the argument doesn't require a type but
the return type is required... The problem is that in a lambda without
{} there can be only one return, the value of the expression, which is
then used for the return type. With the {} form you could have multiple
return statements, thus the compiler likes to check the type.
One way to solve this is to also require argument types for the {} form.
That way it becomes more an inline :def function than a lambda.
A more complicated solution (for the compiler) is the take the common
type of all the return statements.
Thoughts?
--
hundred-and-one symptoms of being an internet addict:
248. You sign your letters with your e-mail address instead of your name.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///