fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

Add better suggestion to solve amiguous partial application error

Open fridis opened this issue 1 year ago • 0 comments

See this small example

> ./build/bin/fz -e 'x => unit |> (exit 0)'

command line:1:15: error 1: Ambiguity between direct and partially applied call target
x => unit |> (exit 0)

This call can be resolved in two ways, either as a direct call to 'exit' declared at $MODULE/exit.fz:107:8:
public exit(code u8) => exit0.exit code

or by partially applying arguments to a call to 'exit' declared at $MODULE/exit.fz:127:8:
public exit(handler Exit_Handler, code ()->unit) =>
.
To solve this, rename one of the ambiguous features.

one error.

Here, renaming is clearly not an option, but using an explicit lambda like

> ./build/bin/fz -e 'x => unit |> (_ -> exit 0)'
>

is. This suggestion should be included in the To solve this,... section.

fridis avatar Aug 30 '24 09:08 fridis