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

[Bug][compiler-v2] Compiler erroneously reports unused assignments in test #15713

Open
alnoki opened this issue Jan 11, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@alnoki
Copy link
Contributor

alnoki commented Jan 11, 2025

@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:

git ls-files | entr -c sh -c " \
       aptos move test --coverage --dev --move-2  &&
       aptos move fmt
   "

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:

warning: Unused assignment to `covered_unequal_market_ids`. Consider removing or prefixing with an underscore: `_covered_unequal_market_ids`
     ┌─ /Users/yours-truly/repos/emojicoin-dot-fun/src/move/emojicoin_arena/tests/tests.move:1741:42
     │
1741 │         let covered_unequal_market_ids = false;

However if I then delete the line, or prefix with _ as suggested, the compiler then reports:

error: undeclared `covered_unequal_market_ids`
     ┌─ /Users/yours-truly/repos/emojicoin-dot-fun/src/move/emojicoin_arena/tests/tests.move:1758:17
     │
1758 │                 covered_unequal_market_ids = true;
     │                 ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: undeclared `covered_unequal_market_ids`
     ┌─ /Users/yours-truly/repos/emojicoin-dot-fun/src/move/emojicoin_arena/tests/tests.move:1783:17
     │
1783 │         assert!(covered_unequal_market_ids);
@alnoki alnoki added the bug Something isn't working label Jan 11, 2025
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

1 participant