Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

afterCompilation attributes are not always applied in noncomputable section #2077

Closed
fpvandoorn opened this issue Jan 30, 2023 · 0 comments
Closed
Labels
Mathlib4 high prio Mathlib4 high priority issue

Comments

@fpvandoorn
Copy link
Contributor

fpvandoorn commented Jan 30, 2023

In the following code, I try to apply simp to three declarations, but it doesn't get applied to baz. In fact, no attributes that run afterCompilation get executed for baz.

import Lean

noncomputable section
@[simp] def foo : Nat := 1
@[simp] noncomputable def bar : Nat := Classical.choice ⟨0@[simp] def baz : Nat := Classical.choice ⟨0-- `@[simp]` attribute doesn't get executed

open Lean Meta Elab Command

#eval liftCoreM <| do
  let x1 := simpExtension.getState (← getEnv) |>.toUnfold.contains <| `foo
  let x2 := simpExtension.getState (← getEnv) |>.toUnfold.contains <| `bar
  let x3 := simpExtension.getState (← getEnv) |>.toUnfold.contains <| `baz
  logInfo m!"{x1} {x2} {x3}" -- returns: "true true false". expected: "true true true"

Version

Lean (version 4.0.0-nightly-2023-01-29, commit 38a0d1e, Release)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mathlib4 high prio Mathlib4 high priority issue
Projects
None yet
Development

No branches or pull requests

2 participants