No partial application warning if piping into `ignore`

Say we have the following:

let buf = Buffer.create 16

Then we mistakenly do:

ignore (Buffer.add_string b)

We rightfully get a warning:

Warning 5: this function application is partial,
maybe some arguments are missing.

But if we mistakenly do:

Buffer.add_string b |> ignore

There’s no warning. Is this to be expected? Should it be considered as a bug? And would it be fixed by the recent work that typechecks |> in the same way as normal function application?

I don’t know if it should be considered a bug, but starting from 4.13, Buffer.add_string b |> ignore does emit the same warning, thanks to the new handling of the applications primitives (|>) and (@@).


I count it a feature that |> ignore now emits the partial application warnings.

1 Like