Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid 'assert false' when looking up module .cmo #803

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/ppx/ppx_eliom_client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ module Pass = struct
let find_fragment loc id =
if Mli.exists ()
then Mli.find_fragment id
else if Cmo.exists ()
then Cmo.find_fragment loc
else [%type: _]
else
match if Cmo.exists () then Cmo.find_fragment loc else None with
| Some typ -> typ
| None -> [%type: _]

let register_client_closures client_value_datas =
let registrations =
Expand Down
4 changes: 1 addition & 3 deletions src/ppx/ppx_eliom_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,7 @@ module Cmo = struct
let find_injected_ident = find "injected ident"

let find_fragment loc =
match Mli.get_fragment_type (find "client value" loc) with
| Some ty -> ty
| None -> assert false
Mli.get_fragment_type (find "client value" loc)
end

(** Context convenience module. *)
Expand Down
2 changes: 1 addition & 1 deletion src/ppx/ppx_eliom_utils.mli
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module Cmo : sig
val exists : unit -> bool
val find_escaped_ident : Location.t -> core_type
val find_injected_ident : Location.t -> core_type
val find_fragment : Location.t -> core_type
val find_fragment : Location.t -> core_type option
end

(** Signature of specific code of a preprocessor. *)
Expand Down