Yes, this error is very stupid. I’ve been staring it for 15+ minutes and can not figure out what is wrong.
- The error itself:
113 | type t = Bump of bump_dir | Toggle_collapse [@@deriving sexp]
^^^^^^^^
Error: Unbound value bump_dir_of_sexp
- So now we ask: is sexp derived on bump_dir ? We put cursor over
bump_dir
, hit goto def, and get:
type bump_dir = Incr | Decr [@@deriivng sexp]
-
Okay, is there another
bump_dir
in the project? (a) according to rg, no: (b) this was also the one that merlin/lsp jumped to -
Well, is bump_dir in scope ?
-
I modify the code to:
let _x: bump_dir = Incr;;
type t = Bump of bump_dir | Toggle_collapse [@@deriving sexp]
Note here, the _x
line does not get an error; the error is still unbound value bump_dir_of_sexp.
- Maybe this is a caching issue?
rm -rf _build; dune build-w
– still same error.
At this point I’m confused – what is there left for me to try?