aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorGaëtan Gilbert2020-03-31 15:21:40 +0200
committerGaëtan Gilbert2020-04-13 21:55:34 +0200
commitee64a71f5e071b7fa0495847388c19d83bc5c9bd (patch)
tree17c919a21a48e65c4e660659c407c63120cc6abc /pretyping
parentf2cdb87232e3b04cbd1e199833253fb3e38156f8 (diff)
Close #11935: section variables do not have universe instances.
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/pretyping.ml10
1 files changed, 9 insertions, 1 deletions
diff --git a/pretyping/pretyping.ml b/pretyping/pretyping.ml
index 015c26531a..940150b15a 100644
--- a/pretyping/pretyping.ml
+++ b/pretyping/pretyping.ml
@@ -438,7 +438,15 @@ let pretype_ref ?loc sigma env ref us =
match ref with
| GlobRef.VarRef id ->
(* Section variable *)
- (try sigma, make_judge (mkVar id) (NamedDecl.get_type (lookup_named id !!env))
+ (try
+ let ty = NamedDecl.get_type (lookup_named id !!env) in
+ (match us with
+ | None | Some [] -> ()
+ | Some (_ :: _) ->
+ CErrors.user_err ?loc
+ Pp.(str "Section variables are not polymorphic:" ++ spc ()
+ ++ str "universe instance should have length 0."));
+ sigma, make_judge (mkVar id) ty
with Not_found ->
(* This may happen if env is a goal env and section variables have
been cleared - section variables should be different from goal