Open gwdjkspnado opened 1 year ago
The % operator cannot be applied to integer constants without explicit type annotation.
%
Minimal code to reproduce the issue
def main() { u32 a = 2 % 1; }
Compile with zokrates compile -i mod.zok, you would get the following error:
zokrates compile -i mod.zok
Compiling mod.zok Compilation failed: mod.zok:2:13 Cannot apply `%` to {integer}, {integer}
If you explicitly specify the types of the integer constants, the error would be gone:
def main() { u32 a = 2u32 % 1u32; }
Description
The
%
operator cannot be applied to integer constants without explicit type annotation.Environment
Steps to Reproduce
Minimal code to reproduce the issue
Compile with
zokrates compile -i mod.zok
, you would get the following error:If you explicitly specify the types of the integer constants, the error would be gone: