aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/variableDeclaration/do_while.sol
diff options
context:
space:
mode:
authorLeonardo Alt <leo@ethereum.org>2018-09-04 17:48:58 +0800
committerLeonardo Alt <leo@ethereum.org>2018-09-04 17:48:58 +0800
commit17176871ab4903498be0f9d62997ca1a9ace04d8 (patch)
tree7fc1d5e1f905fb271c5dcb6c6830cad615194674 /test/libsolidity/syntaxTests/variableDeclaration/do_while.sol
parent4522c804f342707ec2bb86a19735a4084108d96d (diff)
downloaddexon-solidity-17176871ab4903498be0f9d62997ca1a9ace04d8.tar
dexon-solidity-17176871ab4903498be0f9d62997ca1a9ace04d8.tar.gz
dexon-solidity-17176871ab4903498be0f9d62997ca1a9ace04d8.tar.bz2
dexon-solidity-17176871ab4903498be0f9d62997ca1a9ace04d8.tar.lz
dexon-solidity-17176871ab4903498be0f9d62997ca1a9ace04d8.tar.xz
dexon-solidity-17176871ab4903498be0f9d62997ca1a9ace04d8.tar.zst
dexon-solidity-17176871ab4903498be0f9d62997ca1a9ace04d8.zip
Changed error message and added tests
Diffstat (limited to 'test/libsolidity/syntaxTests/variableDeclaration/do_while.sol')
-rw-r--r--test/libsolidity/syntaxTests/variableDeclaration/do_while.sol12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/variableDeclaration/do_while.sol b/test/libsolidity/syntaxTests/variableDeclaration/do_while.sol
new file mode 100644
index 00000000..8fc48b33
--- /dev/null
+++ b/test/libsolidity/syntaxTests/variableDeclaration/do_while.sol
@@ -0,0 +1,12 @@
+pragma solidity >0.4.24;
+
+contract C
+{
+ function f(uint x) public pure {
+ do
+ uint y;
+ while (x > 0);
+ }
+}
+// ----
+// SyntaxError: (81-87): Variable declarations can only be used inside blocks.