aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/constants/addmod_mulmod_rational.sol
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-04-09 21:22:45 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-04-12 03:17:10 +0800
commitdaa69df447e167fe75d57a5bbbabee4d637218a4 (patch)
tree06651c92bf79cbc14a931d28fc161ad480997506 /test/libsolidity/syntaxTests/constants/addmod_mulmod_rational.sol
parent418e2725b50aebc169dd80f78a0ce3eefc2e296e (diff)
downloaddexon-solidity-daa69df447e167fe75d57a5bbbabee4d637218a4.tar.gz
dexon-solidity-daa69df447e167fe75d57a5bbbabee4d637218a4.tar.zst
dexon-solidity-daa69df447e167fe75d57a5bbbabee4d637218a4.zip
Error on invalid arithmetic with constant expressions.
Diffstat (limited to 'test/libsolidity/syntaxTests/constants/addmod_mulmod_rational.sol')
-rw-r--r--test/libsolidity/syntaxTests/constants/addmod_mulmod_rational.sol7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/constants/addmod_mulmod_rational.sol b/test/libsolidity/syntaxTests/constants/addmod_mulmod_rational.sol
new file mode 100644
index 00000000..26712735
--- /dev/null
+++ b/test/libsolidity/syntaxTests/constants/addmod_mulmod_rational.sol
@@ -0,0 +1,7 @@
+contract C {
+ uint constant a = addmod(3, 4, 0.1);
+ uint constant b = mulmod(3, 4, 0.1);
+}
+// ----
+// TypeError: (48-51): Invalid type for argument in function call. Invalid implicit conversion from rational_const 1 / 10 to uint256 requested.
+// TypeError: (89-92): Invalid type for argument in function call. Invalid implicit conversion from rational_const 1 / 10 to uint256 requested.