Skip to content

lambdaMetaTelescope doesn't preserve binder names #14264

Description

@JovanGerb

Prerequisites

Description

lambdaMetaTelescope creates metavariables with anonymous user names instead of using the binder names from the lambda binders.

Context

This caused to_dual in mathlib to generate some definitions where the lambda binder names were wrong. That problem has now been fixed (leanprover-community/mathlib4#40946)

Steps to Reproduce

import Lean

open Lean Meta

/-- info: fun {x} => x -/
#guard_msgs in
run_meta
  let e := Expr.lam `a (.sort 0) (.bvar 0) .default
  let (mvars, _, e) ← lambdaMetaTelescope e
  let e ← mkLambdaFVars mvars e
  logInfo m!"{e}"

Expected behavior: The resulting bound variable is called a

Actual behavior: The resulting bound variable is called x

Versions

4.32.0-rc1

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-lowWe are not planning to work on this issuebugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions