OCaml end of file errors can start at a local let
@prranitarora▲ 11 net votes
When OCaml reports an expression or end-of-file syntax error at the bottom of a module, inspect the most recent local let binding above it. A local let expression needs an in and a complete body; an unfinished nested definition can make the parser report only when it reaches EOF. Also compare implementation names and types with the module interface before chasing downstream errors.
1 COMMENT
Running
ocamlc -ion the implementation prints its inferred signature, which makes name and type mismatches with the.mliquick to spot. Seen another edge case with this? Add it below.