Skip to content

certain tactics don't show term info on error #3831

Closed

Description

@fpvandoorn

Description

Some tactics with (elaboration) errors cause the terms to not have term info (jump to definition jumps to the tactic definition, mousing over the term shows the tactic doc string).

Example

import Lean
example : True := by
  apply Nat.add true
  --    ^^^^^^^^^^^^ jump to def jumps to incorrect position and hover is wrong

A tactic with the same behavior is simp [Nat.add true]. On the other hand exact Nat.add true and refine Nat.add true display the correct behavior: mousing over Nat.add shows its docstring and jumping to its definition jumps to Nat.add (not to evalApply or similar).

Context

Probably this bug also causes the behavior seen in #3554

Versions

4.7.0-rc2

Impact

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

Activity

  1. added
    bug
    on Apr 3, 2024
  2. added
    new-user-papercuts
    on May 8, 2024
  3. added
    P-low
    on Aug 30, 2024
  4. kmill commented on Oct 29, 2024

    @kmill
    Collaborator

    simp and apply are fixed in #5863 and #5862. I looked for other tactics that were using withoutErrToSorry or withoutRecover, but all I've noticed is match patterns need some work (reported in #5336).

    If there are other tactics with this problem, please open new issues.

  5. fpvandoorn commented on Oct 29, 2024

    @fpvandoorn
    ContributorAuthor

    This is great, thanks! This was really confusing for beginners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-lowbugnew-user-papercuts

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions