fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

An arbitray feature that inherits from `Function` cannot be used for lambda

Open fridis opened this issue 3 months ago • 0 comments

Try this code that declares myf as its function type

myf : Function bool i32 is
q(f myf) => f.call 1 |> say

q a->a>0

this produces this error

 > ./build/bin/fz myfun.fz 

/home/fridi/fuzion/clean/fuzion.5/myfun.fz:4:3: error 1: Wrong number of arguments in lambda expression
q a->a>0

Lambda expression has one argument while the target type expects -1 arguments.
Arguments of lambda expression: 'a'
Expected function type: myf
To solve this, remove 2 arguments from the list 'a' before the '->' of the lambda expression.

one error.

while it should best just work.

fridis avatar Sep 22 '25 12:09 fridis