mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-23 02:01:54 +03:00
35 lines
655 B
Markdown
35 lines
655 B
Markdown
# Unexpected whitespace
|
|
|
|
## Example
|
|
|
|
This error occurs when there was unexpected white space when in your program.
|
|
Typically, the white space occurs in a literal with a typed suffix.
|
|
|
|
Erroneous code example:
|
|
|
|
```js
|
|
function main() {
|
|
let x = 1 u8;
|
|
}
|
|
```
|
|
|
|
The compiler will reject this code with:
|
|
|
|
```js
|
|
Error [EPAR0370004]: Unexpected white space between terms 1 and u8
|
|
--> test.leo:2:13
|
|
|
|
|
2 | let x = 1 u8;
|
|
| ^
|
|
```
|
|
|
|
## Solutions
|
|
|
|
The problem is solved by removing the white space between the literal and its suffix. So given the example above, we can fix it by writing:
|
|
|
|
```js
|
|
function main() {
|
|
let x = 1u8;
|
|
}
|
|
```
|