fix: make sure the resulting array size is equal to the number of binders

The following code relies on this property
```lean
       for uid in scope.varUIds, x in xs do
          sectionFVars := sectionFVars.insert uid x
```
This commit is contained in:
Leonardo de Moura 2021-05-04 19:27:36 -07:00
parent fc96a24d7b
commit 164b26bf01
2 changed files with 9 additions and 1 deletions

View file

@ -306,7 +306,7 @@ def getBracketedBinderIds : Syntax → Array Name
| `(bracketedBinder|($ids* $[: $ty?]? $(annot?)?)) => ids.map Syntax.getId
| `(bracketedBinder|{$ids* $[: $ty?]?}) => ids.map Syntax.getId
| `(bracketedBinder|[$id : $ty]) => #[id.getId]
| `(bracketedBinder|[$ty]) => #[]
| `(bracketedBinder|[$ty]) => #[Name.anonymous]
| _ => #[]
private def mkTermContext (ctx : Context) (s : State) (declName? : Option Name) : Term.Context := do

View file

@ -0,0 +1,8 @@
variable {α} [ToString α] (n : Nat)
local macro "foo" : term => `(n)
def f :=
foo
#check f 10