diff options
| author | Pierre-Marie Pédrot | 2019-03-31 23:01:41 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2019-03-31 23:01:41 +0200 |
| commit | cb502e44aac8328ffd6c37429e050a01f72b2c53 (patch) | |
| tree | 9d8f62a6b86af6d1eb233c199ab5cc5416834e6e /pretyping | |
| parent | 44e5afe99d8b40c3ed0d546f56a446427c7c4da4 (diff) | |
| parent | 3fdb62dee9830bb551798ee9c3dd2a3af1493e8d (diff) | |
Merge PR #8829: Error when [foo.(bar)] is used with nonprojection [bar], warn if [bar] nonprimitive projection.
Reviewed-by: ppedrot
Diffstat (limited to 'pretyping')
| -rw-r--r-- | pretyping/recordops.ml | 2 | ||||
| -rw-r--r-- | pretyping/recordops.mli | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/pretyping/recordops.ml b/pretyping/recordops.ml index 6d9e3230a4..fc355c2c79 100644 --- a/pretyping/recordops.ml +++ b/pretyping/recordops.ml @@ -103,6 +103,8 @@ let find_projection = function | ConstRef cst -> Cmap.find cst !projection_table | _ -> raise Not_found +let is_projection cst = Cmap.mem cst !projection_table + let prim_table = Summary.ref (Cmap_env.empty : Projection.Repr.t Cmap_env.t) ~name:"record-prim-projs" diff --git a/pretyping/recordops.mli b/pretyping/recordops.mli index 3e43372b65..76d36c9b62 100644 --- a/pretyping/recordops.mli +++ b/pretyping/recordops.mli @@ -44,6 +44,8 @@ val find_projection_nparams : GlobRef.t -> int (** raise [Not_found] if not a projection *) val find_projection : GlobRef.t -> struc_typ +val is_projection : Constant.t -> bool + (** Sets up the mapping from constants to primitive projections *) val declare_primitive_projection : Projection.Repr.t -> Constant.t -> unit |
