-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Bug][compiler-v2] Compiler erroneously reports unused assignments in test #15713
Comments
The compiler is indeed correct in reporting the unused assignment here. Below is a much more simplified version of the code in question, having deleted a lot of irrelevant code and added comments.
Note that the only way to get out of the The way to fix the warning correctly is to remove the assignment, but keep the declaration, because it is indeed used (i.e., I'll follow up with a minor fix to the warning message that says "Consider removing the assignment, or prefixing with an underscore: ...". The existing "consider removing" may be perceived as suggesting removing the declaration and the assignment altogether. |
@vineethk Thanks! Addressed in econia-labs/emojicoin-dot-fun#632 |
@brmataptos @fEst1ck @georgemitenkov @gregnazario @rahxephon89 @runtian-zhou @vineethk @wrwg
Steps to reproduce
See this file snippet:
https://github.com/econia-labs/emojicoin-dot-fun/blob/4bae268f/src/move/emojicoin_arena/tests/tests.move#L1739-L1752
Then from in src/move/emojicoin_arena:
If I don't call the variables called out in the snippet, then the compiler erroneously reports an unused assignment even though it is used in the test:
However if I then delete the line, or prefix with
_
as suggested, the compiler then reports:The text was updated successfully, but these errors were encountered: