From f3c24a6246249db25bcc5c4a3e34040a8667ca02 Mon Sep 17 00:00:00 2001 From: Gaƫtan Gilbert Date: Mon, 16 Nov 2020 17:38:33 +0100 Subject: Improve bad variance error message: mention expected and actual variances --- kernel/type_errors.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'kernel/type_errors.ml') diff --git a/kernel/type_errors.ml b/kernel/type_errors.ml index 624604976e..bcb7aa88ca 100644 --- a/kernel/type_errors.ml +++ b/kernel/type_errors.ml @@ -69,7 +69,7 @@ type ('constr, 'types) ptype_error = | DisallowedSProp | BadRelevance | BadInvert - | BadVariance of Level.t + | BadVariance of { lev : Level.t; expected : Variance.t; actual : Variance.t } type type_error = (constr, types) ptype_error @@ -164,8 +164,8 @@ let error_bad_relevance env = let error_bad_invert env = raise (TypeError (env, BadInvert)) -let error_bad_variance env u = - raise (TypeError (env, BadVariance u)) +let error_bad_variance env ~lev ~expected ~actual = + raise (TypeError (env, BadVariance {lev;expected;actual})) let map_pguard_error f = function | NotEnoughAbstractionInFixBody -> NotEnoughAbstractionInFixBody -- cgit v1.2.3