From 31fa6a24df0e698a2c086a8efb7162fa13c061b8 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 17 May 2018 09:04:39 +0200 Subject: Move more parser tests to syntax tests --- .../syntaxTests/parsing/conditional_with_assignment.sol | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol (limited to 'test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol') diff --git a/test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol b/test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol new file mode 100644 index 00000000..6f8040d6 --- /dev/null +++ b/test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol @@ -0,0 +1,11 @@ +contract A { + function f() { + uint y = 1; + uint x = 3 < 0 ? x = 3 : 6; + true ? x = 3 : 4; + } +} +// ---- +// Warning: (17-119): No visibility specified. Defaulting to "public". +// Warning: (40-46): Unused local variable. +// Warning: (17-119): Function state mutability can be restricted to pure -- cgit v1.2.3 From 8862b3092bcdbcb8314ec27e2b11bf25fcc6346a Mon Sep 17 00:00:00 2001 From: Leonardo Alt Date: Fri, 15 Jun 2018 12:30:28 +0200 Subject: C99 scoping rules by default --- .../syntaxTests/parsing/conditional_with_assignment.sol | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol') diff --git a/test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol b/test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol index 6f8040d6..7489aaf9 100644 --- a/test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol +++ b/test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol @@ -1,11 +1,8 @@ contract A { - function f() { + function f() public pure { uint y = 1; - uint x = 3 < 0 ? x = 3 : 6; + uint x = 3 < 0 ? y = 3 : 6; true ? x = 3 : 4; } } // ---- -// Warning: (17-119): No visibility specified. Defaulting to "public". -// Warning: (40-46): Unused local variable. -// Warning: (17-119): Function state mutability can be restricted to pure -- cgit v1.2.3