Fable icon indicating copy to clipboard operation
Fable copied to clipboard

Take zero-arity into account when uncurrying

Open alfonsogarciacaro opened this issue 3 years ago • 0 comments

Right now the uncurrying mechanism only takes one-arity into account. However, we usually remove the argument when this is of type unit, so we need to also consider zero-arity.

In JS this hasn't been a problem so far because if we pass an argument to a function without it will simply be ignored. However in Dart, and I assume in other typed languages too, if you try to pass a function like int Function() to an argument expecting int Function(Arg) (where Arg is a generic of the enclosing method), the compiler will complain.

alfonsogarciacaro avatar May 24 '22 12:05 alfonsogarciacaro