chore: add test for 1692
This commit is contained in:
parent
ba57ad3480
commit
6593bd98b3
1 changed files with 21 additions and 0 deletions
21
tests/lean/run/1692.lean
Normal file
21
tests/lean/run/1692.lean
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import Lean.Hygiene
|
||||
|
||||
def otherInhabited : Inhabited Nat := ⟨42⟩
|
||||
|
||||
def f := Id.run do
|
||||
let ⟨n⟩ ← pure otherInhabited
|
||||
-- do-notation expands to `pure otherInhabited >>= fun x : Inhabited Nat => ...`
|
||||
-- the `x : Inhabited Nat` should not be available for TC synth (i.e., `default` should be 0)
|
||||
return default + n
|
||||
|
||||
example : f = 42 := rfl
|
||||
|
||||
open Lean
|
||||
def g : Syntax :=
|
||||
let rec stx : Syntax := Unhygienic.run `(f 0 1)
|
||||
let stx := stx
|
||||
match stx with
|
||||
| `(f $_args*) => ‹Syntax› -- should not resolve to tmp var created by stx matcher
|
||||
| _ => default
|
||||
|
||||
example : g = g.stx := rfl
|
||||
Loading…
Add table
Reference in a new issue