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

Adapt to coq/coq#17667 (handle genarg in patterns) #359

Merged
merged 1 commit into from
Nov 15, 2023
Merged
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
16 changes: 16 additions & 0 deletions serlib/ser_pattern.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ type case_info_pattern =

let hash_fold_array = hash_fold_array_frozen

(** Can't properly serialize this GADT
Currently we only expose the derives for constr_pattern so can't occur anyway.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that if that gets exposed in the future, people will get weird errors on the Ast; up to you, but maybe worth piercing instead, getting the Coq Ast is the main use case of SerAPI these days so I'm wary this could affect lots of ppl.

*)
module UninstS = struct
type 'a t = 'a Pattern.uninstantiated_pattern
let name = "uninstantiated_pattern"
end
module Uninst = SerType.Opaque1(UninstS)

type 'a uninstantiated_pattern = 'a Uninst.t
[@@deriving sexp,yojson,hash,compare]

type 'a constr_pattern_r =
[%import: 'a Pattern.constr_pattern_r]
[@@deriving sexp,yojson,hash,compare]

type constr_pattern =
[%import: Pattern.constr_pattern]
[@@deriving sexp,yojson,hash,compare]