diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-04-12 16:39:13 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-04-12 17:33:54 +0800 |
commit | d42476e241489447e5dc4f5b1fafc8000e635fbc (patch) | |
tree | d78c025b95561c5a0a986e6c6bc6a68e214a2f9a /test/libsolidity/syntaxTests/constants | |
parent | 932915633bb7f5985023f80a8c704cf8c5f979fa (diff) | |
download | dexon-solidity-d42476e241489447e5dc4f5b1fafc8000e635fbc.tar dexon-solidity-d42476e241489447e5dc4f5b1fafc8000e635fbc.tar.gz dexon-solidity-d42476e241489447e5dc4f5b1fafc8000e635fbc.tar.bz2 dexon-solidity-d42476e241489447e5dc4f5b1fafc8000e635fbc.tar.lz dexon-solidity-d42476e241489447e5dc4f5b1fafc8000e635fbc.tar.xz dexon-solidity-d42476e241489447e5dc4f5b1fafc8000e635fbc.tar.zst dexon-solidity-d42476e241489447e5dc4f5b1fafc8000e635fbc.zip |
Add test to check ConstantEvaluator for pure non-rational functions.
Diffstat (limited to 'test/libsolidity/syntaxTests/constants')
-rw-r--r-- | test/libsolidity/syntaxTests/constants/pure_non_rational.sol | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/constants/pure_non_rational.sol b/test/libsolidity/syntaxTests/constants/pure_non_rational.sol new file mode 100644 index 00000000..4b96f1c7 --- /dev/null +++ b/test/libsolidity/syntaxTests/constants/pure_non_rational.sol @@ -0,0 +1,11 @@ +// Tests that the ConstantEvaluator does not crash for pure non-rational functions. +// Currently it does not evaluate such functions, but this may change in the future +// causing a division by zero error for a. +contract C { + uint constant a = 1 / (uint(keccak256([0])[0]) - uint(keccak256([0])[0])); + uint constant b = 1 / uint(keccak256([0])); + uint constant c = uint(keccak256([0])); + uint[c] mem; +} +// ---- +// TypeError: (392-393): Invalid array length, expected integer literal or constant expression. |