diff options
author | chriseth <chris@ethereum.org> | 2018-06-21 19:57:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-21 19:57:59 +0800 |
commit | 0d1047181d22c049aa5573acf9826d1701dd66ae (patch) | |
tree | 2e0295bb85a9a24b97ee6a7c3316d82369805ada /test/libsolidity/syntaxTests/parsing | |
parent | 7e4bd3e3468ec1d240068fde5b45f380cdef411c (diff) | |
parent | 8862b3092bcdbcb8314ec27e2b11bf25fcc6346a (diff) | |
download | dexon-solidity-0d1047181d22c049aa5573acf9826d1701dd66ae.tar dexon-solidity-0d1047181d22c049aa5573acf9826d1701dd66ae.tar.gz dexon-solidity-0d1047181d22c049aa5573acf9826d1701dd66ae.tar.bz2 dexon-solidity-0d1047181d22c049aa5573acf9826d1701dd66ae.tar.lz dexon-solidity-0d1047181d22c049aa5573acf9826d1701dd66ae.tar.xz dexon-solidity-0d1047181d22c049aa5573acf9826d1701dd66ae.tar.zst dexon-solidity-0d1047181d22c049aa5573acf9826d1701dd66ae.zip |
Merge pull request #4306 from ethereum/remove_050_workaround_scoping
[BREAKING] C99 scoping rules by default (remove 050 workaround)
Diffstat (limited to 'test/libsolidity/syntaxTests/parsing')
-rw-r--r-- | test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol | 7 | ||||
-rw-r--r-- | test/libsolidity/syntaxTests/parsing/while_loop.sol | 8 |
2 files changed, 5 insertions, 10 deletions
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 diff --git a/test/libsolidity/syntaxTests/parsing/while_loop.sol b/test/libsolidity/syntaxTests/parsing/while_loop.sol index 129b52e1..dbb00a69 100644 --- a/test/libsolidity/syntaxTests/parsing/while_loop.sol +++ b/test/libsolidity/syntaxTests/parsing/while_loop.sol @@ -1,9 +1,7 @@ contract test { - function fun(uint256 a) { - while (true) { uint256 x = 1; break; continue; } x = 9; + function fun() public pure { + uint256 x; + while (true) { x = 1; break; continue; } x = 9; } } // ---- -// Warning: (20-115): No visibility specified. Defaulting to "public". -// Warning: (33-42): Unused function parameter. Remove or comment out the variable name to silence this warning. -// Warning: (20-115): Function state mutability can be restricted to pure |