diff options
| author | Pierre-Marie Pédrot | 2020-04-14 12:25:24 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2020-04-14 12:25:24 +0200 |
| commit | 7bfdd65398139398a6495fb97ed1ee9383f1606d (patch) | |
| tree | c0792b01bc31d185258ba4637693d4799a936621 /pretyping | |
| parent | b26d17a6a76b6758d0f22eaa025b1c31b474809f (diff) | |
| parent | ee64a71f5e071b7fa0495847388c19d83bc5c9bd (diff) | |
Merge PR #11978: Close #11935: section variables do not have universe instances.
Reviewed-by: ppedrot
Diffstat (limited to 'pretyping')
| -rw-r--r-- | pretyping/pretyping.ml | 10 |
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 |
