lean4-htt/tests/lean/run/4761.lean
Kyle Miller c545e7b0c9
fix: make sure anonymous dot notation works with pi-type-valued type synonyms (#4818)
When resolving anonymous dot notation (`.ident x y z`), it would reduce
the expected type to whnf. Now, it unfolds definitions step-by-step,
even if the type synonym is for a pi type like so
```lean
def Foo : Prop := ∀ a : Nat, a = a
protected theorem Foo.intro : Foo := sorry
example : Foo := .intro
```

Closes #4761
2024-07-24 17:09:42 +00:00

17 lines
454 B
Text

/-!
# Make sure "anonymous dot notation" works with type synonyms.
-/
def Foo : Prop := ∀ a : Nat, a = a
protected theorem Foo.intro : Foo := sorry
example : Foo := .intro
/-!
Making sure that the type synonym `Foo'` still works.
This used to be unfolded during `forallTelescopeReducing`,
and now it is "manually" unfolded in the elaboration algorithm.
-/
example : Nat → Option Nat := .some
def Foo' := Nat → Option Nat
example : Foo' := .some