Closed milancermak closed 1 year ago
Hi @milancermak,
Amarna already finds this with the dead-store rule: there was a value saved in caller
but never used before a return statement:
Let me know if there are examples where you don't see this being found!
Ah, you're right. I even though I saw it before but whilst doing code review on a PR, I've noticed an unused variable but no Amarna warning attached (link if you're curious, line 131 in Food.cairo
). It probably has something to do with the GitHub action, because when I run amarna locally on the file, it does catch it. Sorry for the false alarm 🙏
Amarna already lovingly warns about unused imports, function call arguments or functions themselves. Can you add a rule to warn about unused variables to its arsenal as well?
Example:
In the above example,
caller
is never used. The rule would point it out.