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

Unused variable linter false positive #4828

Closed
3 tasks done
jthulhu opened this issue Jul 25, 2024 · 1 comment
Closed
3 tasks done

Unused variable linter false positive #4828

jthulhu opened this issue Jul 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jthulhu
Copy link

jthulhu commented Jul 25, 2024

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

The linter "unused variables" has a false positive, which, additionally, is reported at the wrong location.

Context

There is no particular context for this issue, here is the Zulip thread where it was reported.

Steps to Reproduce

inductive Foo {α : Type} : α → Type where
 | bar (x : α) : Foo x

def Foo.baz {α : Type} (y : α) : Foo y → Foo y
 | bar _ => bar _

Expected behavior: Nothing is reported in Foo.baz, the both variables bound α and y are used.

Actual behavior: The linter triggers, are reports unused variable `y` , with the reported location being the catch all pattern in the baz branch.

Versions

This has been checked with Lean nightly on the online version of Lean. On my computer, I'm using Lean 4.10.0-rc1, under NixOS unstable.

Impact

This is a very minor issue.

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

@jthulhu jthulhu added the bug Something isn't working label Jul 25, 2024
@Kha
Copy link
Member

Kha commented Aug 1, 2024

duplicate of #2830

@Kha Kha closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants