aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/constants/mod_zero.sol
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/syntaxTests/constants/mod_zero.sol')
-rw-r--r--test/libsolidity/syntaxTests/constants/mod_zero.sol9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/constants/mod_zero.sol b/test/libsolidity/syntaxTests/constants/mod_zero.sol
new file mode 100644
index 00000000..f5e4a23a
--- /dev/null
+++ b/test/libsolidity/syntaxTests/constants/mod_zero.sol
@@ -0,0 +1,9 @@
+contract c {
+ uint constant a1 = 0;
+ uint constant a2 = 1;
+ uint constant b1 = 3 % a1;
+ uint constant b2 = 3 % (a2 - 1);
+}
+// ----
+// TypeError: (88-94): Modulo zero.
+// TypeError: (119-131): Modulo zero.