aboutsummaryrefslogtreecommitdiff
path: root/toplevel
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2016-03-18 15:16:24 +0100
committerPierre-Marie Pédrot2016-03-18 15:19:00 +0100
commit16939df43a089ac30fec0fcf30a2f648d007cb60 (patch)
tree98046b9b2f7671d27ac8e69702afa6b0e2a457ef /toplevel
parentb4b98349d03c31227d0d86a6e3acda8c3cd5212c (diff)
parent34c467a4e41e20a9bf1318d47fbc09da94c5ad97 (diff)
Merge branch 'v8.5'
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/record.ml13
1 files changed, 7 insertions, 6 deletions
diff --git a/toplevel/record.ml b/toplevel/record.ml
index c0bb9eb86c..ae0b885e47 100644
--- a/toplevel/record.ml
+++ b/toplevel/record.ml
@@ -145,12 +145,13 @@ let typecheck_params_and_fields def id pl t ps nots fs =
arity, evars
else
let evars = Evd.set_leq_sort env_ar evars (Type univ) aritysort in
- if Univ.is_small_univ univ then
- (* We can assume that the level aritysort is not constrained
- and clear it. *)
- mkArity (ctx, Sorts.sort_of_univ univ),
- Evd.set_eq_sort env_ar evars (Prop Pos) aritysort
- else arity, evars
+ if Univ.is_small_univ univ &&
+ Option.cata (Evd.is_flexible_level evars) false (Evd.is_sort_variable evars aritysort) then
+ (* We can assume that the level in aritysort is not constrained
+ and clear it, if it is flexible *)
+ mkArity (ctx, Sorts.sort_of_univ univ),
+ Evd.set_eq_sort env_ar evars (Prop Pos) aritysort
+ else arity, evars
in
let evars, nf = Evarutil.nf_evars_and_universes evars in
let newps = Context.Rel.map nf newps in