diff options
author | Leonardo Alt <leo@ethereum.org> | 2018-05-22 23:37:21 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-05-30 22:14:53 +0800 |
commit | ac6871078940f0ae4a47380091fc46ed46a63d0a (patch) | |
tree | 92795e519aeb424245c68420dad1e9bd97bd473b /test/libsolidity/syntaxTests | |
parent | 41965ca2626e1e09de7fb1eb40ae4751b5e289fa (diff) | |
download | dexon-solidity-ac6871078940f0ae4a47380091fc46ed46a63d0a.tar.gz dexon-solidity-ac6871078940f0ae4a47380091fc46ed46a63d0a.tar.zst dexon-solidity-ac6871078940f0ae4a47380091fc46ed46a63d0a.zip |
Disallow trailing dots that are not followed by a number
Diffstat (limited to 'test/libsolidity/syntaxTests')
-rw-r--r-- | test/libsolidity/syntaxTests/parsing/trailing_dot1.sol | 7 | ||||
-rw-r--r-- | test/libsolidity/syntaxTests/parsing/trailing_dot2.sol | 7 | ||||
-rw-r--r-- | test/libsolidity/syntaxTests/parsing/trailing_dot3.sol | 4 |
3 files changed, 18 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/parsing/trailing_dot1.sol b/test/libsolidity/syntaxTests/parsing/trailing_dot1.sol new file mode 100644 index 00000000..7f26242c --- /dev/null +++ b/test/libsolidity/syntaxTests/parsing/trailing_dot1.sol @@ -0,0 +1,7 @@ +contract test { + uint256 a = 2.2e10; + uint256 b = .5E10; + uint256 c = 4.e-2; +} +// ---- +// TypeError: (70-73): Member "e" not found or not visible after argument-dependent lookup in int_const 4 diff --git a/test/libsolidity/syntaxTests/parsing/trailing_dot2.sol b/test/libsolidity/syntaxTests/parsing/trailing_dot2.sol new file mode 100644 index 00000000..38a7ab2d --- /dev/null +++ b/test/libsolidity/syntaxTests/parsing/trailing_dot2.sol @@ -0,0 +1,7 @@ +contract test { + uint256 a = 2.2e10; + uint256 b = .5E10; + uint256 c = 2 + 2.; +} +// ---- +// ParserError: (76-77): Expected identifier but got ';' diff --git a/test/libsolidity/syntaxTests/parsing/trailing_dot3.sol b/test/libsolidity/syntaxTests/parsing/trailing_dot3.sol new file mode 100644 index 00000000..6a126cb3 --- /dev/null +++ b/test/libsolidity/syntaxTests/parsing/trailing_dot3.sol @@ -0,0 +1,4 @@ +contract test { + uint a = 2. +// ---- +// ParserError: (29-29): Expected identifier but got end of source |