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
With the following code you may encounter an error on sui move build. The best way to reproduce is to use '<' sign attached with the variable on its left inside if or while.
I have tested it multiple times and got the same error.
Thanks for reporting this @purusang! This is a known issue and it has to do with lexing and parsing the code. The team is aware of this and added it to the backlog.
In the meantime, please use spaces before and after the < character to avoid this parsing error.
Steps to Reproduce Issue
With the following code you may encounter an error on
sui move build
. The best way to reproduce is to use '<' sign attached with the variable on its left insideif
orwhile
.I have tested it multiple times and got the same error.
My code snippet:
Expected Result
Compilation should have been successful.
Actual Result
error[E01002]: unexpected token
┌─ ./sources/merkle_tree.move:47:29
│
47 │ while(j< sub_len){
│ ^
│ │
│ Unexpected ')'
│ Expected ',' or '>'
error[E01002]: unexpected token
┌─ ./sources/merkle_tree.move:47:30
│
47 │ while(j< sub_len){
│ - ^ Expected '>'
│ │
│ To match this '<'
error[E01002]: unexpected token
┌─ ./sources/merkle_tree.move:50:14
│
50 │ };
│ ^
│ │
│ Unexpected ';'
│ Expected ')'
error[E01002]: unexpected token
┌─ ./sources/merkle_tree.move:52:10
│
52 │ };
│ ^
│ │
│ Unexpected ';'
│ Expected a module member: 'spec', 'use', 'friend', 'const', 'fun', 'struct', or 'enum'
Failed to build Move modules: Compilation error.
System Information
The text was updated successfully, but these errors were encountered: