lean4-htt/tests/lean/run/issue2975.lean
Joachim Breitner d4fdb5d7c0
fix: getFunInfo, inferType to use withAtLeastTransparency, not withTransparency (#5563)
when the transparency mode is `.all`, then one expects `getFunInfo` and
`inferType` to also work with that transparency mode.

Fixes #5562
Fixes #2975 
Fixes #2194
2024-10-04 13:04:35 +00:00

19 lines
396 B
Text

import Lean
open Lean Meta Elab Term
elab "#reduce'" t:term : command => Elab.Command.runTermElabM fun _ => do
let e ← withSynthesize <| elabTerm t none
let e ← Meta.reduce e
withTransparency TransparencyMode.all do
logInfo m!"{← inferType e}"
structure S where
x : Nat
def S' := S
def S'.x (s : S') : Nat := S.x s
attribute [irreducible] S'
variable (s : S')
#reduce' s.x