diff options
| author | Pierre-Marie Pédrot | 2020-03-11 10:00:57 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2020-03-11 10:00:57 +0100 |
| commit | baae1974d5ee15233cddffa1281d4a23fc74cc9f (patch) | |
| tree | 15d5eb92eabcde13f4f0b959c1c932be0783c772 | |
| parent | c64623b766854b4a5adc674e3966a359da2d0ef8 (diff) | |
| parent | b02ae8e4faa26ded157c9379572e9a43e0394290 (diff) | |
Merge PR #11786: Fix #11730: Mangle Names vs Infix
Reviewed-by: herbelin
Reviewed-by: ppedrot
| -rw-r--r-- | test-suite/bugs/closed/bug_11730.v | 6 | ||||
| -rw-r--r-- | vernac/metasyntax.ml | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/test-suite/bugs/closed/bug_11730.v b/test-suite/bugs/closed/bug_11730.v new file mode 100644 index 0000000000..f788636f9c --- /dev/null +++ b/test-suite/bugs/closed/bug_11730.v @@ -0,0 +1,6 @@ +Set Mangle Names. + +Infix "&&&" := andb (at level 40, left associativity). +(* Error: Variable _0 occurs more than once. *) + +Check (_ &&& _). diff --git a/vernac/metasyntax.ml b/vernac/metasyntax.ml index 33fd14a731..10946d78f0 100644 --- a/vernac/metasyntax.ml +++ b/vernac/metasyntax.ml @@ -1708,7 +1708,7 @@ let add_infix ~local deprecation env ({CAst.loc;v=inf},modifiers) pr sc = (* check the precedence *) let vars = names_of_constr_expr pr in let x = Namegen.next_ident_away (Id.of_string "x") vars in - let y = Namegen.next_ident_away (Id.of_string "y") vars in + let y = Namegen.next_ident_away (Id.of_string "y") (Id.Set.add x vars) in let metas = [inject_var x; inject_var y] in let c = mkAppC (pr,metas) in let df = CAst.make ?loc @@ Id.to_string x ^" "^(quote_notation_token inf)^" "^Id.to_string y in |
