It seems ocamlcp creates some nonsense code when encountering a refutation case. I'm experimenting with adding support for ocamlprof in dune, so ignore the dune commands they don't exist yet.
$ cat > foo.ml <<EOF
> type t = |
>
> let unreachable_code = function
> | (_ : t) -> .
> ;;
> EOF
$ dune exec --profile ocamlprof --always-show-command-line -- ./foo.exe
(cd _build/default && /nix/store/sc6v3ijmixhacylaxwn00nbvsyw4qxi3-ocaml+flambda-5.3.0/bin/ocamloptp -w -40 -g -I .foo.eobjs/byte -I .foo.eobjs/native -I .bar.objs/byte -I .bar.objs/native -cmi-file .foo.eobjs/byte/dune__exe__Foo.cmi -no-alias-deps -o .foo.eobjs/native/dune__exe__Foo.cmx -c -impl foo.ml)
File "foo.ml", line 4, characters 66-67:
4 | | (_ : t) -> (OCAML__prof_Profiling.incr __ocaml_prof_foo_cnt 0; .)
^
Error: Syntax error: ) expected
File "foo.ml", line 4, characters 14-15:
4 | | (_ : t) -> (OCAML__prof_Profiling.incr __ocaml_prof_foo_cnt 0; .)
^
This ( might be unmatched
[1]
It seems
ocamlcpcreates some nonsense code when encountering a refutation case. I'm experimenting with adding support for ocamlprof in dune, so ignore the dune commands they don't exist yet.