Debian Codegraph @

pretyping/typeclasses_errors.ml

raw symbols SCIP
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 open Names
12 open EConstr
13 open Environ
14
15 type typeclass_error =
16 | NotAClass of constr
17 | UnboundMethod of GlobRef.t * lident (* Class name, method *)
18
19 exception TypeClassError of env * Evd.evar_map * typeclass_error
20
21 let typeclass_error env sigma err = raise (TypeClassError (env, sigma, err))
22
23 let not_a_class env sigma c = typeclass_error env sigma (NotAClass c)
24
25 let unbound_method env sigma cid id = typeclass_error env sigma (UnboundMethod (cid, id))