diff options
author | Leonardo Alt <leo@ethereum.org> | 2018-06-15 18:30:28 +0800 |
---|---|---|
committer | Leonardo Alt <leo@ethereum.org> | 2018-06-20 18:53:38 +0800 |
commit | 8862b3092bcdbcb8314ec27e2b11bf25fcc6346a (patch) | |
tree | 4570b3adc9678c944546144f5989629003422194 /test/libsolidity/syntaxTests/parsing | |
parent | ba7fbf11e72a4f9da149ac3c9b4c908e4f215250 (diff) | |
download | dexon-solidity-8862b3092bcdbcb8314ec27e2b11bf25fcc6346a.tar.gz dexon-solidity-8862b3092bcdbcb8314ec27e2b11bf25fcc6346a.tar.zst dexon-solidity-8862b3092bcdbcb8314ec27e2b11bf25fcc6346a.zip |
C99 scoping rules by default
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 |