fix: unhygiene in expandExplicitBinders
This commit is contained in:
parent
7992ce6b4d
commit
3f6c5f17db
3 changed files with 10 additions and 2 deletions
|
|
@ -46,7 +46,7 @@ def expandBrackedBindersAux (combinator : Syntax) (binders : Array Syntax) (body
|
|||
loop binders.size body
|
||||
|
||||
def expandExplicitBinders (combinatorDeclName : Name) (explicitBinders : Syntax) (body : Syntax) : MacroM Syntax := do
|
||||
let combinator := mkIdentFrom (← getRef) combinatorDeclName
|
||||
let combinator := mkCIdentFrom (← getRef) combinatorDeclName
|
||||
let explicitBinders := explicitBinders[0]
|
||||
if explicitBinders.getKind == ``Lean.unbracketedExplicitBinders then
|
||||
let idents := explicitBinders[0].getArgs
|
||||
|
|
@ -58,7 +58,7 @@ def expandExplicitBinders (combinatorDeclName : Name) (explicitBinders : Syntax)
|
|||
Macro.throwError "unexpected explicit binder"
|
||||
|
||||
def expandBrackedBinders (combinatorDeclName : Name) (bracketedExplicitBinders : Syntax) (body : Syntax) : MacroM Syntax := do
|
||||
let combinator := mkIdentFrom (← getRef) combinatorDeclName
|
||||
let combinator := mkCIdentFrom (← getRef) combinatorDeclName
|
||||
expandBrackedBindersAux combinator #[bracketedExplicitBinders] body
|
||||
|
||||
syntax unifConstraint := term patternIgnore(" =?= " <|> " ≟ ") term
|
||||
|
|
|
|||
7
tests/lean/expandExplicitBinders.lean
Normal file
7
tests/lean/expandExplicitBinders.lean
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
namespace MySigma
|
||||
/-- We define a new `Sigma` -/
|
||||
def Sigma {α : Type u} (β : α → Type v)
|
||||
:= String
|
||||
|
||||
#reduce Σ a, a -- This should not reduce to `String`
|
||||
end MySigma
|
||||
1
tests/lean/expandExplicitBinders.lean.expected.out
Normal file
1
tests/lean/expandExplicitBinders.lean.expected.out
Normal file
|
|
@ -0,0 +1 @@
|
|||
(a : Type u_1) × a
|
||||
Loading…
Add table
Reference in a new issue