From 17176871ab4903498be0f9d62997ca1a9ace04d8 Mon Sep 17 00:00:00 2001 From: Leonardo Alt Date: Tue, 4 Sep 2018 11:48:58 +0200 Subject: Changed error message and added tests --- .../libsolidity/syntaxTests/variableDeclaration/do_while.sol | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/libsolidity/syntaxTests/variableDeclaration/do_while.sol (limited to 'test/libsolidity/syntaxTests/variableDeclaration/do_while.sol') 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. -- cgit v1.2.3