Skip to content

simp attribute + unknown identifiers = internal exception #3 / PANIC at Lean.MetavarContext.getDecl Lean.MetavarContext:448:17: unknown metavariable #12020

@Julian

Description

@Julian

Prerequisites

Description

The code below produces a PANIC at the first @[simp] and an internal exception #3 at the second one.

Context

set_option autoImplicit false

structure Foo where
  foo := 37

variable {G : Foo}
def Foo.bar {U : Type} (f : Nat → Nat) := G.foo = G.foo

variable (C : G.bar baz)
include C

@[simp]
theorem quux : G.foo ↔ G.foo :=
  sorry

@[simp]
theorem eggs : true :=
  sorry

Steps to Reproduce

  1. Move the cursor to either simp

Expected behavior:: Probably some unknown identifier error depending on where the "real" error is occuring, but alternatively some error about metavariables without a backtrace if that's appropriate.

Actual behavior: : Observe a backtrace at the first one, and an internal exception at the second

Versions

[Output of #version or #eval Lean.versionString] 4.27.0-rc1
[OS version, if not using live.lean-lang.org.] macOS

Additional Information

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions