aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-05-31 00:51:52 +0800
committerGitHub <noreply@github.com>2018-05-31 00:51:52 +0800
commit0a1a8bfb09f996ad288baf4f195d621e143de7d9 (patch)
treec02a87fa814cad222cd138b54fc73f52251983b1 /test/libsolidity/syntaxTests
parent0e3d4f773fb40c3368d968e165c24ff653860120 (diff)
parentac6871078940f0ae4a47380091fc46ed46a63d0a (diff)
downloaddexon-solidity-0a1a8bfb09f996ad288baf4f195d621e143de7d9.tar.gz
dexon-solidity-0a1a8bfb09f996ad288baf4f195d621e143de7d9.tar.zst
dexon-solidity-0a1a8bfb09f996ad288baf4f195d621e143de7d9.zip
Merge pull request #4172 from ethereum/trailing_dot
[BREAKING] Disallow trailing dot not followed by number
Diffstat (limited to 'test/libsolidity/syntaxTests')
-rw-r--r--test/libsolidity/syntaxTests/parsing/trailing_dot1.sol7
-rw-r--r--test/libsolidity/syntaxTests/parsing/trailing_dot2.sol7
-rw-r--r--test/libsolidity/syntaxTests/parsing/trailing_dot3.sol4
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