Closed Andriamanitra closed 2 months ago
Expected behavior
CodinGame adds parens like (n+1) as usize.
This is not true, CG does the same and as such the stub also crashes in the IDE
This is a hack (and a dirty one), that even crashes their stub before entering the IDE (and I'm not even sure why it ends up working).
You can test it yourself:
Expected behavior CodinGame adds parens like (n+1) as usize.
This is not true, CG does the same and as such the stub also crashes in the IDE
Oops you're right. I've edited the issue description.
Turns out it's no longer possible to create clashes with loop N+1
so this problem only happened with one legacy clash which is now fixed.
Describe the bug Stub generator for Rust can produce invalid code when a variable is used in an arithmetic expression describing the number of times to loop. This is because in the expression
n+1 as usize
theas usize
cast only applies to1
instead ofn+1
.To Reproduce
Expected behavior We could add parens like
(n+1) as usize
. Another option would ben as usize + 1
.