diff options
Diffstat (limited to 'test/libsolidity/syntaxTests/parsing')
4 files changed, 28 insertions, 53 deletions
diff --git a/test/libsolidity/syntaxTests/parsing/if_statement.sol b/test/libsolidity/syntaxTests/parsing/if_statement.sol index 0819cb9f..451fba1f 100644 --- a/test/libsolidity/syntaxTests/parsing/if_statement.sol +++ b/test/libsolidity/syntaxTests/parsing/if_statement.sol @@ -1,11 +1,9 @@ contract test { function fun(uint256 a) returns (uint) { - if (a >= 8) { return 2; } else { var b = 7; } + if (a >= 8) { return 2; } else { uint b = 7; } } } // ---- -// Warning: (102-107): Use of the "var" keyword is deprecated. -// Warning: (102-111): The type of this variable was inferred as uint8, which can hold values between 0 and 255. This is probably not desired. Use an explicit type to silence this warning. -// Warning: (20-120): No visibility specified. Defaulting to "public". -// Warning: (102-107): Unused local variable. -// Warning: (20-120): Function state mutability can be restricted to pure +// Warning: (20-121): No visibility specified. Defaulting to "public". +// Warning: (102-108): Unused local variable. +// Warning: (20-121): Function state mutability can be restricted to pure diff --git a/test/libsolidity/syntaxTests/parsing/multi_variable_declarations.sol b/test/libsolidity/syntaxTests/parsing/multi_variable_declarations.sol index 818999df..1984ed36 100644 --- a/test/libsolidity/syntaxTests/parsing/multi_variable_declarations.sol +++ b/test/libsolidity/syntaxTests/parsing/multi_variable_declarations.sol @@ -1,29 +1,15 @@ contract C { - function f() { - var (a,b,c) = g(); - var (d) = 2; - var (,e) = 3; - var (f,) = 4; - var (x,,) = g(); - var (,y,) = g(); - var () = g(); - var (,,) = g(); + function f() pure public { + (uint a, uint b, uint c) = g(); + (uint d) = 2; + (, uint e) = 3; + (uint h,) = 4; + (uint x,,) = g(); + (, uint y,) = g(); + a; b; c; d; e; h; x; y; } - function g() returns (uint, uint, uint) {} + function g() pure public returns (uint, uint, uint) {} } // ---- -// Warning: (36-37): Use of the "var" keyword is deprecated. -// Warning: (38-39): Use of the "var" keyword is deprecated. -// Warning: (40-41): Use of the "var" keyword is deprecated. -// Warning: (57-58): Use of the "var" keyword is deprecated. -// Warning: (73-74): Use of the "var" keyword is deprecated. -// Warning: (88-89): Use of the "var" keyword is deprecated. -// Warning: (104-105): Use of the "var" keyword is deprecated. -// Warning: (124-125): Use of the "var" keyword is deprecated. -// Warning: (88-89): This declaration shadows an existing declaration. -// Warning: (52-63): The type of this variable was inferred as uint8, which can hold values between 0 and 255. This is probably not desired. Use an explicit type to silence this warning. -// Warning: (67-79): Different number of components on the left hand side (2) than on the right hand side (1). -// Warning: (67-79): The type of this variable was inferred as uint8, which can hold values between 0 and 255. This is probably not desired. Use an explicit type to silence this warning. -// Warning: (83-95): Different number of components on the left hand side (2) than on the right hand side (1). -// Warning: (83-95): The type of this variable was inferred as uint8, which can hold values between 0 and 255. This is probably not desired. Use an explicit type to silence this warning. -// TypeError: (137-149): Too many components (3) in value for variable assignment (0) needed +// Warning: (93-107): Different number of components on the left hand side (2) than on the right hand side (1). +// Warning: (111-124): Different number of components on the left hand side (2) than on the right hand side (1). diff --git a/test/libsolidity/syntaxTests/parsing/placeholder_in_function_context.sol b/test/libsolidity/syntaxTests/parsing/placeholder_in_function_context.sol index 72546dc0..e331440d 100644 --- a/test/libsolidity/syntaxTests/parsing/placeholder_in_function_context.sol +++ b/test/libsolidity/syntaxTests/parsing/placeholder_in_function_context.sol @@ -1,11 +1,9 @@ contract c { function fun() returns (uint r) { - var _ = 8; + uint _ = 8; return _ + 1; } } // ---- -// Warning: (59-64): Use of the "var" keyword is deprecated. -// Warning: (59-68): The type of this variable was inferred as uint8, which can hold values between 0 and 255. This is probably not desired. Use an explicit type to silence this warning. -// Warning: (17-97): No visibility specified. Defaulting to "public". -// Warning: (17-97): Function state mutability can be restricted to pure +// Warning: (17-98): No visibility specified. Defaulting to "public". +// Warning: (17-98): Function state mutability can be restricted to pure diff --git a/test/libsolidity/syntaxTests/parsing/tuples.sol b/test/libsolidity/syntaxTests/parsing/tuples.sol index 6f739740..d691da44 100644 --- a/test/libsolidity/syntaxTests/parsing/tuples.sol +++ b/test/libsolidity/syntaxTests/parsing/tuples.sol @@ -1,24 +1,17 @@ contract C { function f() { uint a = (1); - var (b,) = (1,); - var (c,d) = (1, 2 + a); - var (e,) = (1, 2, b); + (uint b,) = (1,); + (uint c, uint d) = (1, 2 + a); + (uint e,) = (1, 2, b); (a) = 3; } } // ---- -// Warning: (52-53): Use of the "var" keyword is deprecated. -// Warning: (71-72): Use of the "var" keyword is deprecated. -// Warning: (73-74): Use of the "var" keyword is deprecated. -// Warning: (97-98): Use of the "var" keyword is deprecated. -// Warning: (47-62): Different number of components on the left hand side (2) than on the right hand side (1). -// Warning: (47-62): The type of this variable was inferred as uint8, which can hold values between 0 and 255. This is probably not desired. Use an explicit type to silence this warning. -// Warning: (66-88): The type of this variable was inferred as uint8, which can hold values between 0 and 255. This is probably not desired. Use an explicit type to silence this warning. -// Warning: (92-112): Different number of components on the left hand side (2) than on the right hand side (3). -// Warning: (92-112): The type of this variable was inferred as uint8, which can hold values between 0 and 255. This is probably not desired. Use an explicit type to silence this warning. -// Warning: (14-127): No visibility specified. Defaulting to "public". -// Warning: (71-72): Unused local variable. -// Warning: (73-74): Unused local variable. -// Warning: (97-98): Unused local variable. -// Warning: (14-127): Function state mutability can be restricted to pure +// Warning: (47-63): Different number of components on the left hand side (2) than on the right hand side (1). +// Warning: (100-121): Different number of components on the left hand side (2) than on the right hand side (3). +// Warning: (14-136): No visibility specified. Defaulting to "public". +// Warning: (68-74): Unused local variable. +// Warning: (76-82): Unused local variable. +// Warning: (101-107): Unused local variable. +// Warning: (14-136): Function state mutability can be restricted to pure |