aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChristian Parpart <christian@parpart.family>2018-06-11 20:15:27 +0800
committerChristian Parpart <christian@ethereum.org>2018-06-26 16:40:26 +0800
commite38139c800a780ee6d7aeb55af86aea16a08a907 (patch)
treed6f2fe45fce21ba5980cf4a63e84701ebf9f37d8 /test
parenta083ccd4575bede56724e9ef851a2035f7d5ffb0 (diff)
downloaddexon-solidity-e38139c800a780ee6d7aeb55af86aea16a08a907.tar.gz
dexon-solidity-e38139c800a780ee6d7aeb55af86aea16a08a907.tar.zst
dexon-solidity-e38139c800a780ee6d7aeb55af86aea16a08a907.zip
test: Adapted to the change of the var-keyword elimination.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/syntaxTests/empty_string_var.sol11
-rw-r--r--test/libsolidity/syntaxTests/functionTypes/delete_function_type.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/005_type_inference_smoke_test.sol8
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/012_type_inference_explicit_conversion.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/013_large_string_literal.sol7
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/016_assignment_to_mapping.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/017_assignment_to_struct.sol3
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/025_comparison_of_mapping_types.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/109_disallow_declaration_of_void_type.sol7
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/120_warn_var_from_uint8.sol9
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/121_warn_var_from_uint256.sol9
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/122_warn_var_from_int8.sol9
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/123_warn_var_from_zero.sol8
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/178_assignment_of_nonoverloaded_function.sol3
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/179_assignment_of_overloaded_function.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/183_uninitialized_var.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/188_string_index.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/189_string_length.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/208_assignment_mem_to_local_storage_variable.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/213_no_delete_on_storage_pointers.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/230_creating_contract_within_the_contract.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/238_multi_variable_declaration_fail.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/239_multi_variable_declaration_wildcards_fine.sol22
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/240_multi_variable_declaration_wildcards_fail_1.sol8
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/241_multi_variable_declaration_wildcards_fail_2.sol7
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/242_multi_variable_declaration_wildcards_fail_3.sol7
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/243_multi_variable_declaration_wildcards_fail_4.sol8
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/244_tuples.sol16
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/247_multi_variable_declaration_wildcards_fail_6.sol9
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/262_bound_function_in_var.sol8
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/263_create_memory_arrays.sol8
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/264_mapping_in_memory_array.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/265_new_for_non_array.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/266_invalid_args_creating_memory_array.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/267_invalid_args_creating_struct.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/288_conditional_with_all_types.sol31
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/333_fixed_point_casting_exponents_15.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/334_fixed_point_casting_exponents_neg.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/335_var_capable_of_holding_constant_rationals.sol16
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/336_var_and_rational_with_tuple.sol12
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/337_var_handle_divided_integers.sol10
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/405_address_checksum_type_deduction.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/488_function_types_selector_5.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/490_function_types_selector_7.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/535_address_overload_resolution.sol5
-rw-r--r--test/libsolidity/syntaxTests/parsing/if_statement.sol10
-rw-r--r--test/libsolidity/syntaxTests/parsing/multi_variable_declarations.sol36
-rw-r--r--test/libsolidity/syntaxTests/parsing/placeholder_in_function_context.sol8
-rw-r--r--test/libsolidity/syntaxTests/parsing/tuples.sol27
-rw-r--r--test/libsolidity/syntaxTests/tupleAssignments/warn_fill_vardecl.sol7
50 files changed, 119 insertions, 320 deletions
diff --git a/test/libsolidity/syntaxTests/empty_string_var.sol b/test/libsolidity/syntaxTests/empty_string_var.sol
deleted file mode 100644
index e9837590..00000000
--- a/test/libsolidity/syntaxTests/empty_string_var.sol
+++ /dev/null
@@ -1,11 +0,0 @@
-contract C {
- function f() {
- var a = "";
- bytes1 b = bytes1(a);
- bytes memory c = bytes(a);
- string memory d = string(a);
- }
-}
-// ----
-// Warning: (34-39): Use of the "var" keyword is deprecated.
-// TypeError: (61-70): Explicit type conversion not allowed from "string memory" to "bytes1".
diff --git a/test/libsolidity/syntaxTests/functionTypes/delete_function_type.sol b/test/libsolidity/syntaxTests/functionTypes/delete_function_type.sol
index a6fe6c22..2481c455 100644
--- a/test/libsolidity/syntaxTests/functionTypes/delete_function_type.sol
+++ b/test/libsolidity/syntaxTests/functionTypes/delete_function_type.sol
@@ -3,15 +3,13 @@ contract C {
function(uint) internal returns (uint) y;
function f() public {
delete x;
- var a = y;
+ function(uint) internal returns (uint) a = y;
delete a;
delete y;
- var c = f;
+ function() internal c = f;
delete c;
function(uint) internal returns (uint) g;
delete g;
}
}
// ----
-// Warning: (157-162): Use of the "var" keyword is deprecated.
-// Warning: (212-217): Use of the "var" keyword is deprecated.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/005_type_inference_smoke_test.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/005_type_inference_smoke_test.sol
deleted file mode 100644
index 4c4c62a5..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/005_type_inference_smoke_test.sol
+++ /dev/null
@@ -1,8 +0,0 @@
-contract test {
- function f(uint256 arg1, uint32 arg2) public returns (bool ret) {
- var x = arg1 + arg2 == 8; ret = x;
- }
-}
-// ----
-// Warning: (94-99): Use of the "var" keyword is deprecated.
-// Warning: (20-134): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/012_type_inference_explicit_conversion.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/012_type_inference_explicit_conversion.sol
deleted file mode 100644
index 70d31f25..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/012_type_inference_explicit_conversion.sol
+++ /dev/null
@@ -1,6 +0,0 @@
-contract test {
- function f() public returns (int256 r) { var x = int256(uint32(2)); return x; }
-}
-// ----
-// Warning: (61-66): Use of the "var" keyword is deprecated.
-// Warning: (20-99): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/013_large_string_literal.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/013_large_string_literal.sol
index 18ff6054..7f858a4d 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/013_large_string_literal.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/013_large_string_literal.sol
@@ -1,7 +1,6 @@
contract test {
- function f() public { var x = "123456789012345678901234567890123"; }
+ function f() public { string memory x = "123456789012345678901234567890123"; }
}
// ----
-// Warning: (42-47): Use of the "var" keyword is deprecated.
-// Warning: (42-47): Unused local variable.
-// Warning: (20-88): Function state mutability can be restricted to pure
+// Warning: (42-57): Unused local variable.
+// Warning: (20-98): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/016_assignment_to_mapping.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/016_assignment_to_mapping.sol
index 764f630f..8bf45c3f 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/016_assignment_to_mapping.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/016_assignment_to_mapping.sol
@@ -4,10 +4,9 @@ contract test {
}
str data;
function fun() public {
- var a = data.map;
+ mapping(uint=>uint) a = data.map;
data.map = a;
}
}
// ----
-// Warning: (122-127): Use of the "var" keyword is deprecated.
-// TypeError: (148-160): Mappings cannot be assigned to.
+// TypeError: (164-176): Mappings cannot be assigned to.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/017_assignment_to_struct.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/017_assignment_to_struct.sol
index f7db0b24..6fbd09ae 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/017_assignment_to_struct.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/017_assignment_to_struct.sol
@@ -4,9 +4,8 @@ contract test {
}
str data;
function fun() public {
- var a = data;
+ str storage a = data;
data = a;
}
}
// ----
-// Warning: (122-127): Use of the "var" keyword is deprecated.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/025_comparison_of_mapping_types.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/025_comparison_of_mapping_types.sol
index 78d89ef8..27651d63 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/025_comparison_of_mapping_types.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/025_comparison_of_mapping_types.sol
@@ -1,10 +1,9 @@
contract C {
mapping(uint => uint) x;
function f() public returns (bool ret) {
- var y = x;
+ mapping(uint => uint) y = x;
return x == y;
}
}
// ----
-// Warning: (95-100): Use of the "var" keyword is deprecated.
-// TypeError: (121-127): Operator == not compatible with types mapping(uint256 => uint256) and mapping(uint256 => uint256)
+// TypeError: (139-145): Operator == not compatible with types mapping(uint256 => uint256) and mapping(uint256 => uint256)
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/109_disallow_declaration_of_void_type.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/109_disallow_declaration_of_void_type.sol
deleted file mode 100644
index b79b976a..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/109_disallow_declaration_of_void_type.sol
+++ /dev/null
@@ -1,7 +0,0 @@
-contract c {
- function f() public { var (x) = f(); }
-}
-// ----
-// Warning: (44-45): Use of the "var" keyword is deprecated.
-// Warning: (39-52): Different number of components on the left hand side (1) than on the right hand side (0).
-// TypeError: (39-52): Not enough components (0) in value to assign all variables (1).
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/120_warn_var_from_uint8.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/120_warn_var_from_uint8.sol
deleted file mode 100644
index db086252..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/120_warn_var_from_uint8.sol
+++ /dev/null
@@ -1,9 +0,0 @@
-contract test {
- function f() pure public returns (uint) {
- var i = 1;
- return i;
- }
-}
-// ----
-// Warning: (70-75): Use of the "var" keyword is deprecated.
-// Warning: (70-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.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/121_warn_var_from_uint256.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/121_warn_var_from_uint256.sol
deleted file mode 100644
index 2b48ce5d..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/121_warn_var_from_uint256.sol
+++ /dev/null
@@ -1,9 +0,0 @@
-contract test {
- function f() pure public {
- var i = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
- i;
- }
-}
-// ----
-// Warning: (55-60): Use of the "var" keyword is deprecated.
-// Warning: (55-129): The type of this variable was inferred as uint256, which can hold values between 0 and 115792089237316195423570985008687907853269984665640564039457584007913129639935. This is probably not desired. Use an explicit type to silence this warning.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/122_warn_var_from_int8.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/122_warn_var_from_int8.sol
deleted file mode 100644
index bebcbab5..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/122_warn_var_from_int8.sol
+++ /dev/null
@@ -1,9 +0,0 @@
-contract test {
- function f() pure public {
- var i = -2;
- i;
- }
-}
-// ----
-// Warning: (55-60): Use of the "var" keyword is deprecated.
-// Warning: (55-65): The type of this variable was inferred as int8, which can hold values between -128 and 127. This is probably not desired. Use an explicit type to silence this warning.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/123_warn_var_from_zero.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/123_warn_var_from_zero.sol
deleted file mode 100644
index 3d269993..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/123_warn_var_from_zero.sol
+++ /dev/null
@@ -1,8 +0,0 @@
- contract test {
- function f() pure public {
- for (var i = 0; i < msg.data.length; i++) { }
- }
- }
-// ----
-// Warning: (63-68): Use of the "var" keyword is deprecated.
-// Warning: (63-72): 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.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/178_assignment_of_nonoverloaded_function.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/178_assignment_of_nonoverloaded_function.sol
index f7daa33f..07fc1c43 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/178_assignment_of_nonoverloaded_function.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/178_assignment_of_nonoverloaded_function.sol
@@ -1,7 +1,6 @@
contract test {
function f(uint a) public returns (uint) { return 2 * a; }
- function g() public returns (uint) { var x = f; return x(7); }
+ function g() public returns (uint) { function (uint) returns (uint) x = f; return x(7); }
}
// ----
-// Warning: (120-125): Use of the "var" keyword is deprecated.
// Warning: (20-78): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/179_assignment_of_overloaded_function.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/179_assignment_of_overloaded_function.sol
index 375980c3..9ed864f1 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/179_assignment_of_overloaded_function.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/179_assignment_of_overloaded_function.sol
@@ -1,8 +1,7 @@
contract test {
function f() public returns (uint) { return 1; }
function f(uint a) public returns (uint) { return 2 * a; }
- function g() public returns (uint) { var x = f; return x(7); }
+ function g() public returns (uint) { function (uint) returns (uint) x = f; return x(7); }
}
// ----
-// Warning: (173-178): Use of the "var" keyword is deprecated.
-// TypeError: (181-182): No matching declaration found after variable lookup.
+// TypeError: (208-209): No matching declaration found after variable lookup.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/183_uninitialized_var.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/183_uninitialized_var.sol
deleted file mode 100644
index 61836b59..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/183_uninitialized_var.sol
+++ /dev/null
@@ -1,6 +0,0 @@
-contract C {
- function f() public returns (uint) { var x; return 2; }
-}
-// ----
-// Warning: (54-59): Use of the "var" keyword is deprecated.
-// TypeError: (54-59): Assignment necessary for type detection.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/188_string_index.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/188_string_index.sol
index 8e838537..9d51e06b 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/188_string_index.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/188_string_index.sol
@@ -1,7 +1,6 @@
contract C {
string s;
- function f() public { var a = s[2]; }
+ function f() public { bytes1 a = s[2]; }
}
// ----
-// Warning: (53-58): Use of the "var" keyword is deprecated.
-// TypeError: (61-65): Index access for string is not possible.
+// TypeError: (64-68): Index access for string is not possible.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/189_string_length.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/189_string_length.sol
index 36be82c9..9e714d68 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/189_string_length.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/189_string_length.sol
@@ -1,7 +1,6 @@
contract C {
string s;
- function f() public { var a = s.length; }
+ function f() public { uint a = s.length; }
}
// ----
-// Warning: (53-58): Use of the "var" keyword is deprecated.
-// TypeError: (61-69): Member "length" not found or not visible after argument-dependent lookup in string storage ref
+// TypeError: (62-70): Member "length" not found or not visible after argument-dependent lookup in string storage ref
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/208_assignment_mem_to_local_storage_variable.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/208_assignment_mem_to_local_storage_variable.sol
index a2048a8a..febe39e6 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/208_assignment_mem_to_local_storage_variable.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/208_assignment_mem_to_local_storage_variable.sol
@@ -1,10 +1,9 @@
contract C {
uint[] data;
function f(uint[] x) public {
- var dataRef = data;
+ uint[] storage dataRef = data;
dataRef = x;
}
}
// ----
-// Warning: (72-83): Use of the "var" keyword is deprecated.
-// TypeError: (110-111): Type uint256[] memory is not implicitly convertible to expected type uint256[] storage pointer.
+// TypeError: (121-122): Type uint256[] memory is not implicitly convertible to expected type uint256[] storage pointer.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/213_no_delete_on_storage_pointers.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/213_no_delete_on_storage_pointers.sol
index d17b62e4..7a6fb1c7 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/213_no_delete_on_storage_pointers.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/213_no_delete_on_storage_pointers.sol
@@ -1,10 +1,9 @@
contract C {
uint[] data;
function f() public {
- var x = data;
+ uint[] storage x = data;
delete x;
}
}
// ----
-// Warning: (64-69): Use of the "var" keyword is deprecated.
-// TypeError: (86-94): Unary operator delete cannot be applied to type uint256[] storage pointer
+// TypeError: (97-105): Unary operator delete cannot be applied to type uint256[] storage pointer
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/230_creating_contract_within_the_contract.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/230_creating_contract_within_the_contract.sol
index 8dbaef9c..8624b0b0 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/230_creating_contract_within_the_contract.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/230_creating_contract_within_the_contract.sol
@@ -1,6 +1,5 @@
contract Test {
- function f() public { var x = new Test(); }
+ function f() public { Test x = new Test(); }
}
// ----
-// Warning: (42-47): Use of the "var" keyword is deprecated.
-// TypeError: (50-58): Circular reference for contract creation (cannot create instance of derived or same contract).
+// TypeError: (51-59): Circular reference for contract creation (cannot create instance of derived or same contract).
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/238_multi_variable_declaration_fail.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/238_multi_variable_declaration_fail.sol
deleted file mode 100644
index de115d12..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/238_multi_variable_declaration_fail.sol
+++ /dev/null
@@ -1,5 +0,0 @@
-contract C { function f() public { var (x,y); x = 1; y = 1;} }
-// ----
-// Warning: (40-41): Use of the "var" keyword is deprecated.
-// Warning: (42-43): Use of the "var" keyword is deprecated.
-// TypeError: (35-44): Assignment necessary for type detection.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/239_multi_variable_declaration_wildcards_fine.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/239_multi_variable_declaration_wildcards_fine.sol
index a1cfb070..ae260ce4 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/239_multi_variable_declaration_wildcards_fine.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/239_multi_variable_declaration_wildcards_fine.sol
@@ -3,24 +3,18 @@ contract C {
function two() public returns (uint, uint);
function none();
function f() public {
- var (a,) = three();
- var (b,c,) = two();
- var (,d) = three();
- var (,e,g) = two();
+ (uint a,) = three();
+ (uint b, uint c,) = two();
+ (,uint d) = three();
+ (,uint e, uint g) = two();
var (,,) = three();
var () = none();
a;b;c;d;e;g;
}
}
// ----
-// Warning: (177-178): Use of the "var" keyword is deprecated.
-// Warning: (205-206): Use of the "var" keyword is deprecated.
-// Warning: (207-208): Use of the "var" keyword is deprecated.
-// Warning: (234-235): Use of the "var" keyword is deprecated.
-// Warning: (262-263): Use of the "var" keyword is deprecated.
-// Warning: (264-265): Use of the "var" keyword is deprecated.
-// Warning: (172-190): Different number of components on the left hand side (2) than on the right hand side (3).
-// Warning: (200-218): Different number of components on the left hand side (3) than on the right hand side (2).
-// Warning: (228-246): Different number of components on the left hand side (2) than on the right hand side (3).
-// Warning: (256-274): Different number of components on the left hand side (3) than on the right hand side (2).
+// Warning: (172-191): Different number of components on the left hand side (2) than on the right hand side (3).
+// Warning: (201-226): Different number of components on the left hand side (3) than on the right hand side (2).
+// Warning: (236-255): Different number of components on the left hand side (2) than on the right hand side (3).
+// Warning: (265-290): Different number of components on the left hand side (3) than on the right hand side (2).
// Warning: (121-137): No visibility specified. Defaulting to "public".
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/240_multi_variable_declaration_wildcards_fail_1.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/240_multi_variable_declaration_wildcards_fail_1.sol
index 526ff4e8..0ccbb327 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/240_multi_variable_declaration_wildcards_fail_1.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/240_multi_variable_declaration_wildcards_fail_1.sol
@@ -1,9 +1,7 @@
contract C {
function one() public returns (uint);
- function f() public { var (a, b, ) = one(); }
+ function f() public { (uint a, uint b, ) = one(); }
}
// ----
-// Warning: (86-87): Use of the "var" keyword is deprecated.
-// Warning: (89-90): Use of the "var" keyword is deprecated.
-// Warning: (81-101): Different number of components on the left hand side (3) than on the right hand side (1).
-// TypeError: (81-101): Not enough components (1) in value to assign all variables (2).
+// Warning: (81-107): Different number of components on the left hand side (3) than on the right hand side (1).
+// TypeError: (81-107): Not enough components (1) in value to assign all variables (2).
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/241_multi_variable_declaration_wildcards_fail_2.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/241_multi_variable_declaration_wildcards_fail_2.sol
index e41edb64..8d5de125 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/241_multi_variable_declaration_wildcards_fail_2.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/241_multi_variable_declaration_wildcards_fail_2.sol
@@ -1,8 +1,7 @@
contract C {
function one() public returns (uint);
- function f() public { var (a, , ) = one(); }
+ function f() public { (uint a, , ) = one(); }
}
// ----
-// Warning: (86-87): Use of the "var" keyword is deprecated.
-// Warning: (81-100): Different number of components on the left hand side (3) than on the right hand side (1).
-// TypeError: (81-100): Not enough components (1) in value to assign all variables (2).
+// Warning: (81-101): Different number of components on the left hand side (3) than on the right hand side (1).
+// TypeError: (81-101): Not enough components (1) in value to assign all variables (2).
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/242_multi_variable_declaration_wildcards_fail_3.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/242_multi_variable_declaration_wildcards_fail_3.sol
index 202b79c6..993df9b9 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/242_multi_variable_declaration_wildcards_fail_3.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/242_multi_variable_declaration_wildcards_fail_3.sol
@@ -1,8 +1,7 @@
contract C {
function one() public returns (uint);
- function f() public { var (, , a) = one(); }
+ function f() public { (, , uint a) = one(); }
}
// ----
-// Warning: (90-91): Use of the "var" keyword is deprecated.
-// Warning: (81-100): Different number of components on the left hand side (3) than on the right hand side (1).
-// TypeError: (81-100): Not enough components (1) in value to assign all variables (2).
+// Warning: (81-101): Different number of components on the left hand side (3) than on the right hand side (1).
+// TypeError: (81-101): Not enough components (1) in value to assign all variables (2).
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/243_multi_variable_declaration_wildcards_fail_4.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/243_multi_variable_declaration_wildcards_fail_4.sol
index 79f2f3b5..0697b789 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/243_multi_variable_declaration_wildcards_fail_4.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/243_multi_variable_declaration_wildcards_fail_4.sol
@@ -1,9 +1,7 @@
contract C {
function one() public returns (uint);
- function f() public { var (, a, b) = one(); }
+ function f() public { (, uint a, uint b) = one(); }
}
// ----
-// Warning: (88-89): Use of the "var" keyword is deprecated.
-// Warning: (91-92): Use of the "var" keyword is deprecated.
-// Warning: (81-101): Different number of components on the left hand side (3) than on the right hand side (1).
-// TypeError: (81-101): Not enough components (1) in value to assign all variables (2).
+// Warning: (81-107): Different number of components on the left hand side (3) than on the right hand side (1).
+// TypeError: (81-107): Not enough components (1) in value to assign all variables (2).
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/244_tuples.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/244_tuples.sol
index 43553af9..3112f67a 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/244_tuples.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/244_tuples.sol
@@ -1,17 +1,13 @@
contract C {
function f() public {
uint a = (1);
- var (b,) = (uint8(1),);
- var (c,d) = (uint32(1), 2 + a);
- var (e,) = (uint64(1), 2, b);
+ (uint b,) = (uint8(1),);
+ (uint c, uint d) = (uint32(1), 2 + a);
+ (uint e,) = (uint64(1), 2, b);
a;b;c;d;e;
}
}
// ----
-// Warning: (74-75): Use of the "var" keyword is deprecated.
-// Warning: (106-107): Use of the "var" keyword is deprecated.
-// Warning: (108-109): Use of the "var" keyword is deprecated.
-// Warning: (146-147): Use of the "var" keyword is deprecated.
-// Warning: (69-91): Different number of components on the left hand side (2) than on the right hand side (1).
-// Warning: (141-169): Different number of components on the left hand side (2) than on the right hand side (3).
-// Warning: (17-195): Function state mutability can be restricted to pure
+// Warning: (69-92): Different number of components on the left hand side (2) than on the right hand side (1).
+// Warning: (149-178): Different number of components on the left hand side (2) than on the right hand side (3).
+// Warning: (17-204): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/247_multi_variable_declaration_wildcards_fail_6.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/247_multi_variable_declaration_wildcards_fail_6.sol
index 734ba09c..cc5953db 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/247_multi_variable_declaration_wildcards_fail_6.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/247_multi_variable_declaration_wildcards_fail_6.sol
@@ -1,10 +1,7 @@
contract C {
function two() public returns (uint, uint);
- function f() public { var (a, b, c) = two(); }
+ function f() public { (uint a, uint b, uint c) = two(); }
}
// ----
-// Warning: (92-93): Use of the "var" keyword is deprecated.
-// Warning: (95-96): Use of the "var" keyword is deprecated.
-// Warning: (98-99): Use of the "var" keyword is deprecated.
-// Warning: (87-108): Different number of components on the left hand side (3) than on the right hand side (2).
-// TypeError: (87-108): Not enough components (2) in value to assign all variables (3).
+// Warning: (87-119): Different number of components on the left hand side (3) than on the right hand side (2).
+// TypeError: (87-119): Not enough components (2) in value to assign all variables (3).
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/262_bound_function_in_var.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/262_bound_function_in_var.sol
index 09e357e6..c3cc5232 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/262_bound_function_in_var.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/262_bound_function_in_var.sol
@@ -3,9 +3,11 @@ contract C {
using D for D.s;
D.s x;
function f(uint a) public returns (uint) {
- var g = x.mul;
- return g({x: a});
+ function (D.s storage, uint) returns (uint) g = x.mul;
+ g(x, a);
+ g(a);
}
}
// ----
-// Warning: (218-223): Use of the "var" keyword is deprecated.
+// TypeError: (218-271): Type function (struct D.s storage pointer,uint256) returns (uint256) is not implicitly convertible to expected type function (struct D.s storage pointer,uint256) returns (uint256).
+// TypeError: (298-302): Wrong argument count for function call: 1 arguments given but expected 2.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/263_create_memory_arrays.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/263_create_memory_arrays.sol
index acb5a0b5..71f43992 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/263_create_memory_arrays.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/263_create_memory_arrays.sol
@@ -5,12 +5,10 @@ library L {
contract C {
function f(uint size) public {
L.S[][] memory x = new L.S[][](10);
- var y = new uint[](20);
- var z = new bytes(size);
+ uint[] memory y = new uint[](20);
+ bytes memory z = new bytes(size);
x;y;z;
}
}
// ----
-// Warning: (205-210): Use of the "var" keyword is deprecated.
-// Warning: (237-242): Use of the "var" keyword is deprecated.
-// Warning: (122-282): Function state mutability can be restricted to pure
+// Warning: (122-301): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/264_mapping_in_memory_array.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/264_mapping_in_memory_array.sol
index 8ad26fc0..f0bb557b 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/264_mapping_in_memory_array.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/264_mapping_in_memory_array.sol
@@ -1,8 +1,7 @@
contract C {
function f(uint size) public {
- var x = new mapping(uint => uint)[](4);
+ mapping(uint => uint) x = new mapping(uint => uint)[](4);
}
}
// ----
-// Warning: (56-61): Use of the "var" keyword is deprecated.
-// TypeError: (68-91): Type cannot live outside storage.
+// TypeError: (86-109): Type cannot live outside storage.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/265_new_for_non_array.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/265_new_for_non_array.sol
index 1dd81fde..c4b2c692 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/265_new_for_non_array.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/265_new_for_non_array.sol
@@ -1,8 +1,7 @@
contract C {
function f(uint size) public {
- var x = new uint(7);
+ uint x = new uint(7);
}
}
// ----
-// Warning: (56-61): Use of the "var" keyword is deprecated.
-// TypeError: (64-72): Contract or array type expected.
+// TypeError: (65-73): Contract or array type expected.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/266_invalid_args_creating_memory_array.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/266_invalid_args_creating_memory_array.sol
index ea3556de..078255e3 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/266_invalid_args_creating_memory_array.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/266_invalid_args_creating_memory_array.sol
@@ -1,8 +1,7 @@
contract C {
function f(uint size) public {
- var x = new uint[]();
+ uint[] memory x = new uint[]();
}
}
// ----
-// Warning: (56-61): Use of the "var" keyword is deprecated.
-// TypeError: (64-76): Wrong argument count for function call: 0 arguments given but expected 1.
+// TypeError: (74-86): Wrong argument count for function call: 0 arguments given but expected 1.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/267_invalid_args_creating_struct.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/267_invalid_args_creating_struct.sol
index 9a169468..35671e6f 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/267_invalid_args_creating_struct.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/267_invalid_args_creating_struct.sol
@@ -2,9 +2,8 @@ contract C {
struct S { uint a; uint b; }
function f() public {
- var s = S({a: 1});
+ S memory s = S({a: 1});
}
}
// ----
-// Warning: (81-86): Use of the "var" keyword is deprecated.
-// TypeError: (89-98): Wrong argument count for struct constructor: 1 arguments given but expected 2.
+// TypeError: (94-103): Wrong argument count for struct constructor: 1 arguments given but expected 2.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/288_conditional_with_all_types.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/288_conditional_with_all_types.sol
index 4075f6f3..41e72d60 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/288_conditional_with_all_types.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/288_conditional_with_all_types.sol
@@ -25,7 +25,7 @@ contract C {
h += 1; // Avoid unused var warning
// string literal
- var i = true ? "hello" : "world";
+ string memory i = true ? "hello" : "world";
i = "used"; //Avoid unused var warning
}
function f2() public {
@@ -38,18 +38,18 @@ contract C {
// array
byte[2] memory a;
byte[2] memory b;
- var k = true ? a : b;
+ byte[2] memory k = true ? a : b;
k[0] = byte(0); //Avoid unused var warning
bytes memory e;
bytes memory f;
- var l = true ? e : f;
+ bytes memory l = true ? e : f;
l[0] = byte(0); // Avoid unused var warning
// fixed bytes
bytes2 c;
bytes2 d;
- var m = true ? c : d;
+ bytes2 m = true ? c : d;
m &= m;
}
@@ -60,7 +60,7 @@ contract C {
struct_x = true ? struct_x : struct_y;
// function
- var r = true ? fun_x : fun_y;
+ function () r = true ? fun_x : fun_y;
r(); // Avoid unused var warning
// enum
small enum_x;
@@ -68,13 +68,13 @@ contract C {
enum_x = true ? enum_x : enum_y;
// tuple
- var (n, o) = true ? (1, 2) : (3, 4);
+ (uint n, uint o) = true ? (1, 2) : (3, 4);
(n, o) = (o, n); // Avoid unused var warning
// mapping
- var p = true ? table1 : table2;
+ mapping(uint8 => uint8) p = true ? table1 : table2;
p[0] = 0; // Avoid unused var warning
// typetype
- var q = true ? uint32(1) : uint32(2);
+ uint32 q = true ? uint32(1) : uint32(2);
q += 1; // Avoid unused var warning
// modifier doesn't fit in here
@@ -84,17 +84,8 @@ contract C {
}
}
// ----
-// Warning: (546-551): Use of the "var" keyword is deprecated.
-// Warning: (878-883): Use of the "var" keyword is deprecated.
-// Warning: (1008-1013): Use of the "var" keyword is deprecated.
-// Warning: (1150-1155): Use of the "var" keyword is deprecated.
-// Warning: (1357-1362): Use of the "var" keyword is deprecated.
-// Warning: (1560-1561): Use of the "var" keyword is deprecated.
-// Warning: (1563-1564): Use of the "var" keyword is deprecated.
-// Warning: (1672-1677): Use of the "var" keyword is deprecated.
-// Warning: (1778-1783): Use of the "var" keyword is deprecated.
-// Warning: (984-998): This declaration shadows an existing declaration.
+// Warning: (1005-1019): This declaration shadows an existing declaration.
// Warning: (90-116): Function state mutability can be restricted to pure
// Warning: (121-147): Function state mutability can be restricted to pure
-// Warning: (257-632): Function state mutability can be restricted to pure
-// Warning: (637-1194): Function state mutability can be restricted to pure
+// Warning: (257-642): Function state mutability can be restricted to pure
+// Warning: (647-1227): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/333_fixed_point_casting_exponents_15.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/333_fixed_point_casting_exponents_15.sol
index cfaba794..0fd5f331 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/333_fixed_point_casting_exponents_15.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/333_fixed_point_casting_exponents_15.sol
@@ -1,9 +1,7 @@
contract test {
function f() public {
- var a = 3 ** ufixed(1.5);
+ ufixed a = 3 ** ufixed(1.5);
}
}
// ----
-// Warning: (50-55): Use of the "var" keyword is deprecated.
-// TypeError: (58-74): Operator ** not compatible with types int_const 3 and ufixed128x18
-// Warning: (50-74): 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: (61-77): Operator ** not compatible with types int_const 3 and ufixed128x18
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/334_fixed_point_casting_exponents_neg.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/334_fixed_point_casting_exponents_neg.sol
index 7d2716fd..03d10f7c 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/334_fixed_point_casting_exponents_neg.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/334_fixed_point_casting_exponents_neg.sol
@@ -1,9 +1,7 @@
contract test {
function f() public {
- var c = 42 ** fixed(-1/4);
+ ufixed c = 42 ** fixed(-1/4);
}
}
// ----
-// Warning: (50-55): Use of the "var" keyword is deprecated.
-// TypeError: (58-75): Operator ** not compatible with types int_const 42 and fixed128x18
-// Warning: (50-75): 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: (61-78): Operator ** not compatible with types int_const 42 and fixed128x18
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/335_var_capable_of_holding_constant_rationals.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/335_var_capable_of_holding_constant_rationals.sol
deleted file mode 100644
index dac35a54..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/335_var_capable_of_holding_constant_rationals.sol
+++ /dev/null
@@ -1,16 +0,0 @@
-contract test {
- function f() public {
- var a = 0.12345678;
- var b = 12345678.352;
- var c = 0.00000009;
- a; b; c;
- }
-}
-// ----
-// Warning: (50-55): Use of the "var" keyword is deprecated.
-// Warning: (78-83): Use of the "var" keyword is deprecated.
-// Warning: (108-113): Use of the "var" keyword is deprecated.
-// Warning: (50-68): The type of this variable was inferred as ufixed24x8. This is probably not desired. Use an explicit type to silence this warning.
-// Warning: (78-98): The type of this variable was inferred as ufixed40x3. This is probably not desired. Use an explicit type to silence this warning.
-// Warning: (108-126): The type of this variable was inferred as ufixed8x8. This is probably not desired. Use an explicit type to silence this warning.
-// Warning: (20-150): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/336_var_and_rational_with_tuple.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/336_var_and_rational_with_tuple.sol
deleted file mode 100644
index 2f781a5d..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/336_var_and_rational_with_tuple.sol
+++ /dev/null
@@ -1,12 +0,0 @@
-contract test {
- function f() public {
- var (a, b) = (.5, 1/3);
- a; b;
- }
-}
-// ----
-// Warning: (55-56): Use of the "var" keyword is deprecated.
-// Warning: (58-59): Use of the "var" keyword is deprecated.
-// Warning: (50-72): The type of this variable was inferred as ufixed8x1. This is probably not desired. Use an explicit type to silence this warning.
-// Warning: (50-72): The type of this variable was inferred as ufixed256x77. This is probably not desired. Use an explicit type to silence this warning.
-// Warning: (20-93): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/337_var_handle_divided_integers.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/337_var_handle_divided_integers.sol
deleted file mode 100644
index ef2b912c..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/337_var_handle_divided_integers.sol
+++ /dev/null
@@ -1,10 +0,0 @@
-contract test {
- function f() public {
- var x = 1/3;
- }
-}
-// ----
-// Warning: (50-55): Use of the "var" keyword is deprecated.
-// Warning: (50-61): The type of this variable was inferred as ufixed256x77. This is probably not desired. Use an explicit type to silence this warning.
-// Warning: (50-55): Unused local variable.
-// Warning: (20-68): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/405_address_checksum_type_deduction.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/405_address_checksum_type_deduction.sol
index 221d513e..81cc7d0d 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/405_address_checksum_type_deduction.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/405_address_checksum_type_deduction.sol
@@ -1,9 +1,6 @@
contract C {
function f() public {
- var x = 0xfA0bFc97E48458494Ccd857e1A85DC91F7F0046E;
- x.send(2);
+ (0xfA0bFc97E48458494Ccd857e1A85DC91F7F0046E).transfer(2);
}
}
// ----
-// Warning: (47-52): Use of the "var" keyword is deprecated.
-// Warning: (107-116): Failure condition of 'send' ignored. Consider using 'transfer' instead.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/488_function_types_selector_5.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/488_function_types_selector_5.sol
index 2b96a7ee..5f601db2 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/488_function_types_selector_5.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/488_function_types_selector_5.sol
@@ -1,10 +1,8 @@
contract C {
function h() pure external {
}
- function f() view external returns (bytes4) {
- var g = this.h;
- return g.selector;
+ function f() pure external returns (bytes4) {
+ return this.h.selector;
}
}
// ----
-// Warning: (110-115): Use of the "var" keyword is deprecated.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/490_function_types_selector_7.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/490_function_types_selector_7.sol
index ed6c01c5..9ee7d9bb 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/490_function_types_selector_7.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/490_function_types_selector_7.sol
@@ -3,9 +3,7 @@ contract C {
}
function f() view external returns (bytes4) {
function () pure external g = this.h;
- var i = g;
- return i.selector;
+ return g.selector;
}
}
// ----
-// Warning: (156-161): Use of the "var" keyword is deprecated.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/535_address_overload_resolution.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/535_address_overload_resolution.sol
index 4f185e4d..35f4639e 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/535_address_overload_resolution.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/535_address_overload_resolution.sol
@@ -9,14 +9,13 @@ contract C {
}
contract D {
function f() {
- var x = (new C()).balance();
+ uint x = (new C()).balance();
x;
(new C()).transfer(5);
}
}
// ----
-// Warning: (282-287): Use of the "var" keyword is deprecated.
// Warning: (17-127): No visibility specified. Defaulting to "public".
// Warning: (132-239): No visibility specified. Defaulting to "public".
-// Warning: (259-358): No visibility specified. Defaulting to "public".
+// Warning: (259-359): No visibility specified. Defaulting to "public".
// Warning: (17-127): Function state mutability can be restricted to view
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
diff --git a/test/libsolidity/syntaxTests/tupleAssignments/warn_fill_vardecl.sol b/test/libsolidity/syntaxTests/tupleAssignments/warn_fill_vardecl.sol
index 1d243c7c..23484567 100644
--- a/test/libsolidity/syntaxTests/tupleAssignments/warn_fill_vardecl.sol
+++ b/test/libsolidity/syntaxTests/tupleAssignments/warn_fill_vardecl.sol
@@ -1,11 +1,8 @@
contract C {
function f() public pure returns (uint, uint, uint, uint) {
- // Can later be replaced by (uint a, uint b,) = f();
- var (a,b,) = f();
+ (uint a, uint b,) = f();
a; b;
}
}
// ----
-// Warning: (136-137): Use of the "var" keyword is deprecated.
-// Warning: (138-139): Use of the "var" keyword is deprecated.
-// Warning: (131-147): Different number of components on the left hand side (3) than on the right hand side (4).
+// Warning: (76-99): Different number of components on the left hand side (3) than on the right hand side (4).