movebit / movefmt

Other
5 stars 4 forks source link

Compound bitwise operator `^=` fails despite being valid syntax, nondeterministically #45

Open alnoki opened 1 week ago

alnoki commented 1 week ago

@robinlzw

Trace:

(base) rewards % aptos update movefmt
{
  "Result": "Already up to date (v1.0.6)"
}
(base) rewards % aptos move fmt                  
Formatting file:"/Users/yours-truly/repos/emojicoin-dot-fun/src/move/rewards/sources/emojicoin_dot_fun_claim_link.move"
2024-11-17T04:20:40.970454Z  WARN movefmt: 
            Currently movefmt is still in the beta testing phase.
            The formatting results of the beta version may be incompatible with the official release version.

error[E01002]: unexpected token
    ┌─ /Users/yours-truly/repos/emojicoin-dot-fun/src/move/rewards/sources/emojicoin_dot_fun_claim_link.move:588:38
    │
588 │         invalid_public_key_bytes[0] ^= 0xff;
    │                                      ^
    │                                      │
    │                                      Unexpected '='
    │                                      Expected an expression term

The offending line is

invalid_public_key_bytes[0] ^= 0xff;

which is valid Move 2 syntax

robinlzw commented 1 week ago

Including new syntax such as +=, which is currently not supported. We will support it in the next version