diff options
| author | Hugo Herbelin | 2020-02-25 07:55:49 +0100 |
|---|---|---|
| committer | Hugo Herbelin | 2020-02-25 09:03:44 +0100 |
| commit | f71ec3907c0535bf6831ed60a3656ecbe8ac744f (patch) | |
| tree | f0e3aae3924d5eb1a73895601c497bb0a9ec9dfb | |
| parent | da984ceafbb450dc5a9fe8f8971d8c90a060f233 (diff) | |
Fixing residual bug of #11120.
On the principle that a notation to a constant inherits the implicit
arguments of the constant, a non-applied notation should inherit its
next maximal implicit arguments.
| -rw-r--r-- | interp/constrintern.ml | 4 | ||||
| -rw-r--r-- | test-suite/success/Notations2.v | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/interp/constrintern.ml b/interp/constrintern.ml index c39e61083d..8a820293a0 100644 --- a/interp/constrintern.ml +++ b/interp/constrintern.ml @@ -2057,7 +2057,9 @@ let internalize globalenv env pattern_mode (_, ntnvars as lvar) c = intern env (CAst.make ?loc @@ CPrim (Numeral (SMinus,p))) | CNotation (_,(InConstrEntrySomeLevel,"( _ )"),([a],[],[],[])) -> intern env a | CNotation (_,ntn,args) -> - intern_notation intern env ntnvars loc ntn args + let c = intern_notation intern env ntnvars loc ntn args in + let x, impl, scopes, l = find_appl_head_data c in + apply_impargs x env impl scopes l loc | CGeneralization (b,a,c) -> intern_generalization intern env ntnvars loc b a c | CPrim p -> diff --git a/test-suite/success/Notations2.v b/test-suite/success/Notations2.v index f166a53256..382c252727 100644 --- a/test-suite/success/Notations2.v +++ b/test-suite/success/Notations2.v @@ -194,3 +194,11 @@ Notation q := @p. Check fun A n => q (A * A) (n * n). (* check that argument scopes are propagated *) End InheritanceArgumentScopes. + +Module InheritanceMaximalImplicitPureNotation. + +Definition id {A B:Type} (a:B) := a. +Notation "#" := (@id nat). +Check # = (fun a:nat => a). (* # should inherit its maximal implicit argument *) + +End InheritanceMaximalImplicitPureNotation. |
