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

Properly report location of shadowed variable in warning #3408

Open
andrevidela opened this issue Oct 30, 2024 · 0 comments
Open

Properly report location of shadowed variable in warning #3408

andrevidela opened this issue Oct 30, 2024 · 0 comments

Comments

@andrevidela
Copy link
Collaborator

When warning about shadowed variables, the warning report the name of the type, rather than the location of the shadowing variable

Steps to Reproduce

The test idris/warning/warning001 shows this problem:

a1 : Char
a1 = 'a'

a2 : Char
a2 = 'a'

whyNot : a1 = a2
whyNot = ?hole

Expected Behavior

Warning: We are about to implicitly bind the following lowercase names.
You may be unintentionally shadowing the associated global definitions:
  a1 is shadowing Main.a1
  a2 is shadowing Main.a2

Issue621:8:1--8:7
 4 | 
 5 | a2 : Char
 6 | a2 = 'a'
 7 | 
 8 | whyNot : a1 = a2
              ^^^^^^^

Observed Behavior

Warning: We are about to implicitly bind the following lowercase names.
You may be unintentionally shadowing the associated global definitions:
  a1 is shadowing Main.a1
  a2 is shadowing Main.a2

Issue621:8:1--8:7
 4 | 
 5 | a2 : Char
 6 | a2 = 'a'
 7 | 
 8 | whyNot : a1 = a2
     ^^^^^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant