fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

poor type inference for `outcome.bind`

Open fridis opened this issue 1 year ago • 0 comments

Type inference in this small example does not work

 > ./build/bin/fz -e 'o outcome String := "bla"; ignore (o.bind say)'

command line:1:38: error 1: Failed to infer actual type parameters
o outcome String := "bla"; ignore (o.bind say)

In call to 'outcome.bind', no actual type parameters are given and inference of the type parameters failed.
Expected type parameters: 'B'
Type inference failed for one type parameter 'B'

one error.

adding unit does work

 > ./build/bin/fz -e 'o outcome String := "bla"; ignore (o.bind unit say)'
bla

Would be nice if unit could be inferred. If that would work, this would also permit to add infix >>= that results in a different type.

fridis avatar Sep 18 '24 15:09 fridis