Topic discussion checklist
-
Hi guys. I seem to have issues with compiling when I use latest force version.
-
Is there anyway I can solve this. The error messages are provided below.
-
error
→ /home/ahmed/fuel-project/counter-contract/src/main.sw:18:9
|
16 |
17 | fn count() → u64 {
18 | storage.counter
| ^^^^^^^^^^^^^^^ Mismatched types.
expected: u64
found: StorageKey.
help: Implicit return must match up with block’s type.
19 | }
|
error
→ /home/ahmed/fuel-project/counter-contract/src/main.sw:18:9
|
16 |
17 | fn count() → u64 {
18 | storage.counter
| ^^^^^^^^^^^^^^^ Mismatched types.
expected: u64
found: StorageKey.
help: Function body’s return type does not match up with its return type annotation.
19 | }
|
error
→ /home/ahmed/fuel-project/counter-contract/src/main.sw:23:9
|
21 |
22 | fn increment() {
23 | storage.counter = storage.counter + 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This expression is not valid on the left hand side of a reassignment.
24 | }
25 | }
|
Aborting due to 3 errors.
error: Failed to compile counter-contract
- Any other relevant information