Division and Modulo by Zero does not produce Compiler Error when using shorthand notation /= and %= #14702
Labels
bug 🐛
low effort
There is not much implementation work to be done. The task is very easy or tiny.
low impact
Changes are not very noticeable or potential benefits are limited.
should have
We like the idea but it’s not important enough to be a part of the roadmap.
Description
When performing a Division or Modulo by Zero using the long notation, the compiler reports the 'Division by Zero' or 'Modulo zero' error. When performing the same operations using the shorthand '/=' or '%=' operators, the compiler does not raise any errors, and instead the operation will cause a revert at runtime.
As the shorthand notation is semantically equivalent to the longer syntax, both should produce the same behaviour.
Environment
Steps to Reproduce
The following two contracts will produce an error on compilation:
The following two contracts will compile successfully, and instead revert when calling the function
test()
The text was updated successfully, but these errors were encountered: