Zulip Chat Archive
Stream: general
Topic: breaking the linter
Kevin Buzzard (Jan 03 2021 at 11:41):
import tactic
constants A B C : Type
@[simp] lemma A_eq_B : A = B := sorry
@[simp] lemma B_eq_A : B = A := sorry
#lint -- excessive memory consumption detected at 'vm'
Perhaps this is not relevant because the code is clearly not production-ready? Not sure. I was just trying to knock up a simple example of the simp linter spotting a problem.
Kevin Buzzard (Jan 03 2021 at 11:44):
Oh but this hangs it too so maybe there is a problem.
import tactic
def A := ℕ
def B := ℕ
@[simp] lemma A_eq_B : A = B := rfl
@[simp] lemma B_eq_A : B = A := rfl
#lint
Kevin Buzzard (Jan 03 2021 at 11:45):
Should I open an issue? I am still getting the hang of issues.
Bryan Gin-ge Chen (Jan 03 2021 at 16:10):
cc: @Gabriel Ebner, who wrote the simp
linters.
Gabriel Ebner (Jan 03 2021 at 16:39):
It is expected that this will cause the linter to fail, because B
is not in simp-normal form. (You can simplify it as B = A = B = A = ...)
Gabriel Ebner (Jan 03 2021 at 16:39):
The excessive memory consumption error is not intended, but I'm not sure if there's an easy way to catch it from the Lean side.
Kevin Buzzard (Jan 03 2021 at 17:00):
Just to be clear -- the linter hangs lean rather than fails gracefully
Gabriel Ebner (Jan 03 2021 at 17:04):
Yes, I understand. It is not intentional, but I'm not sure if it's easy to detect. I believe we already have a timeout in there. But feel free to open issue.
Last updated: Dec 20 2023 at 11:08 UTC