You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pattern matching between identical let-bindings produce no shadowing errors #4529
From recollection the shadowing/unused warnings are calculated against the bindings in the original form without the construction of mutually recursive binding groups (where the pattern binding is partitioning this into 2 binding groups). There may be a test around this for unused, at least I was aware of it at the time and considered it not blocking.
Is there a good way to fix this? I'd be more than happy to help out. We had an outage in production due to another bug that was triggered because we had two declarations with the same name like in the example. The wrong declaration was used in the actual code and a warning would likely have made it apparent that there was a bug.
Activity
nwolverson commentedon Feb 7, 2024
From recollection the shadowing/unused warnings are calculated against the bindings in the original form without the construction of mutually recursive binding groups (where the pattern binding is partitioning this into 2 binding groups). There may be a test around this for unused, at least I was aware of it at the time and considered it not blocking.
EMattfolk commentedon Feb 8, 2024
Is there a good way to fix this? I'd be more than happy to help out. We had an outage in production due to another bug that was triggered because we had two declarations with the same name like in the example. The wrong declaration was used in the actual code and a warning would likely have made it apparent that there was a bug.
MonoidMusician commentedon Feb 9, 2024
I haven't looked into it thoroughly yet, but I believe this is the relevant chunk of code:
purescript/src/Language/PureScript/Linter.hs
Lines 39 to 79 in 5589e81
The interesting functions there are in AST/Traversals.hs:
purescript/src/Language/PureScript/AST/Traversals.hs
Lines 544 to 666 in 5589e81
nwolverson commentedon Feb 10, 2024
The issue is that currently
purescript/src/Language/PureScript/Make.hs
Line 114 in 5589e81