leo
leo copied to clipboard
[Bug] incorrect error message for type mismatch
🐛 Bug Report
the following error message points to where the variable was declared instead of where the actual error is. probably the result of https://github.com/AleoHQ/leo/pull/1864
Code snippet to reproduce
function main(a: u8) -> u8 {
let x: u8 = 1u8;
let y: u32 = 1u32;
let z: u8 = x + y;
return z;
}
Stack trace & error message
E:\Work\Aleo\leo-playground>leo\target\debug\leo.exe build
Build Starting...
Build Compiling main program... ("E:\\Work\\Aleo\\leo-playground\\src/main.leo")
Error [ETYC0372002]: Found type `u32` but type `u8` was expected
--> E:\Work\Aleo\leo-playground\src/main.leo:3:5
|
3 | let y: u32 = 1u32;
| ^^^^^^^^^^^^^^^^^
Done Finished in 10 milliseconds
Your Environment
- testnet3 commit 64c47f8bf909d3dfb608cba4486c7b9b196ec812
this was fixed on #1866 but seems to still be an issue on testnet3 as of 5b572278fb1edc94f17807222fe3b710e3ae9962. maybe the change never got carried over?
This is fixed on Leo v1.6.2
Error [ETYC0372003]: Expected type `u8` but type `u32` was found
--> src/main.leo:5:21
|
5 | let z: u8 = x + y;
| ^