Slaus
Slaus

Reputation: 2230

OCaml: Warning S: this expression should have type unit

Code

Stack.pop some_stack;

generates "Warning S: this expression should have type unit.". Is it possible to mute it without assigning result to some variable?

Thank you.

Upvotes: 3

Views: 1107

Answers (2)

Chris Conway
Chris Conway

Reputation: 56019

You can use the the argument "-w -S" to ocamlc/ocamlopt to disable this warning. See the OCaml manual here and here.

Upvotes: 1

corvuscorax
corvuscorax

Reputation: 5950

Call the ignore function with the result of the Stack.pop.

ignore (Stack.pop some_stack);

Upvotes: 10

Related Questions