You cannot create paths by yourself, they are essentially the compiled (resolved and unique) variants of Longident.t
.
If you are creating a path with a persistent ident, you are essentially asking for the compilation unit m.mli
. So the lookup try to read the m.cmi
file because it is the path that you asked; and it fails because you are forbidding Env
to read cmis with without_cmis
.
The functions for finding values by longident
are here: https://github.com/ocaml/ocaml/blob/trunk/typing/env.mli#L234