aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2016-08-28 19:43:00 +0200
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2016-08-28 19:43:46 +0200
commit2b4517cf85432d68e53ac46815309fd8068a40ad (patch)
treeee8ceaefc9cbb5ee5362fd4c00a68ceeff09e752
parent26ed8658149d14efa6e4d077c573481281cb610e (diff)
Fix bug #4764: Syntactic notation externalization breaks.
-rw-r--r--interp/notation_ops.ml6
-rw-r--r--test-suite/bugs/closed/4764.v5
2 files changed, 9 insertions, 2 deletions
diff --git a/interp/notation_ops.ml b/interp/notation_ops.ml
index f3e0682bd..de56dbe0a 100644
--- a/interp/notation_ops.ml
+++ b/interp/notation_ops.ml
@@ -1128,13 +1128,15 @@ let match_notation_constr u c (metas,pat) =
List.fold_right (fun (x,(scl,typ)) (terms',termlists',binders') ->
match typ with
| NtnTypeConstr ->
- ((Id.List.assoc x terms, scl)::terms',termlists',binders')
+ let term = try Id.List.assoc x terms with Not_found -> raise No_match in
+ ((term, scl)::terms',termlists',binders')
| NtnTypeOnlyBinder ->
((find_binder x, scl)::terms',termlists',binders')
| NtnTypeConstrList ->
(terms',(Id.List.assoc x termlists,scl)::termlists',binders')
| NtnTypeBinderList ->
- (terms',termlists',(Id.List.assoc x binderlists,scl)::binders'))
+ let bl = try Id.List.assoc x binderlists with Not_found -> raise No_match in
+ (terms',termlists',(bl, scl)::binders'))
metas ([],[],[])
(* Matching cases pattern *)
diff --git a/test-suite/bugs/closed/4764.v b/test-suite/bugs/closed/4764.v
new file mode 100644
index 000000000..e545cc1b7
--- /dev/null
+++ b/test-suite/bugs/closed/4764.v
@@ -0,0 +1,5 @@
+Notation prop_fun x y := (fun (x : Prop) => y).
+Definition foo := fun (p : Prop) => p.
+Definition bar := fun (_ : Prop) => O.
+Print foo.
+Print bar.