Parentheses dropped, resulting in changed arithmetic order.
epi opened this issue · comments
Adrian Matoga commented
Consider
class Foo {
int Bar(int a, int b) => a * (b / 100);
}
Bar
gets translated to the following C++:
int Foo::bar(int a, int b) const
{
return a * b / 100;
}
resulting in arithmetic overflow in cases which the parentheses should prevent.
Piotr Fusik commented
Thanks for reporting this! Fixed now. It was also causing rounding errors.