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:
parent
fc96a24d7b
commit
164b26bf01
2 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
8
tests/lean/run/secVarBug.lean
Normal file
8
tests/lean/run/secVarBug.lean
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
variable {α} [ToString α] (n : Nat)
|
||||
|
||||
local macro "foo" : term => `(n)
|
||||
|
||||
def f :=
|
||||
foo
|
||||
|
||||
#check f 10
|
||||
Loading…
Add table
Reference in a new issue