mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-24 18:52:58 +03:00
681 B
681 B
static const
after normal variables
Example
This error occurs when static const
circuit members occur after normal member variables.
Erroneous code example:
circuit Foo {
bar: u8,
static const baz: bool = true;
}
The compiler will reject this code with, for example...:
Error [EPAR0370020]: Member variables must come after member consts.
--> test.leo:4:18
|
4 | static const baz: bool = true;
| ^^^^^^^^^^^^^^^^
Solution
The issue can be solved by moving all static const
members before normal member variables...:
circuit Foo {
static const baz: bool = true;
bar: u8,
}