aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/ABIEncoderTests.cpp34
-rw-r--r--test/libsolidity/GasMeter.cpp6
-rw-r--r--test/libsolidity/Imports.cpp2
-rw-r--r--test/libsolidity/SMTChecker.cpp14
-rw-r--r--test/libsolidity/SolidityABIJSON.cpp4
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp246
-rw-r--r--test/libsolidity/SolidityExpressionCompiler.cpp2
-rw-r--r--test/libsolidity/SolidityOptimizer.cpp20
-rw-r--r--test/libsolidity/SolidityTypes.cpp20
-rw-r--r--test/libsolidity/syntaxTests/constants/cyclic_dependency_2.sol8
-rw-r--r--test/libsolidity/syntaxTests/constants/cyclic_dependency_4.sol4
-rw-r--r--test/libsolidity/syntaxTests/deprecated_functions.sol8
-rw-r--r--test/libsolidity/syntaxTests/empty_string_var.sol11
-rw-r--r--test/libsolidity/syntaxTests/fallback/default_visibility.sol6
-rw-r--r--test/libsolidity/syntaxTests/fallback/pure_modifier.sol4
-rw-r--r--test/libsolidity/syntaxTests/fallback/view_modifier.sol4
-rw-r--r--test/libsolidity/syntaxTests/functionTypes/delete_function_type.sol6
-rw-r--r--test/libsolidity/syntaxTests/globalFunctions/call_with_wrong_arg_count.sol13
-rw-r--r--test/libsolidity/syntaxTests/globalFunctions/callcode_with_wrong_arg_count.sol11
-rw-r--r--test/libsolidity/syntaxTests/globalFunctions/delegatecall_with_wrong_arg_count.sol11
-rw-r--r--test/libsolidity/syntaxTests/globalFunctions/keccak256_with_wrong_arg_count.sol11
-rw-r--r--test/libsolidity/syntaxTests/globalFunctions/ripemd160_with_wrong_arg_count.sol11
-rw-r--r--test/libsolidity/syntaxTests/globalFunctions/sha256_with_wrong_arg_count.sol11
-rw-r--r--test/libsolidity/syntaxTests/multiVariableDeclaration/multiVariableDeclarationInvalid.sol8
-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/074_fallback_function.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/075_fallback_function_with_arguments.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/076_fallback_function_in_library.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/077_fallback_function_with_return_parameters.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/078_fallback_function_twice.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/079_fallback_function_inheritance.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/080_event.sol3
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/090_event_call.sol3
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/094_event_inheritance.sol3
-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/196_integer_boolean_or.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/197_integer_boolean_and.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/198_integer_boolean_not.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/199_integer_unsigned_exp_signed.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/200_integer_signed_exp_unsigned.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/201_integer_signed_exp_signed.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/202_bytes_reference_compare_operators.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol11
-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/235_abi_encode_with_large_integer_constant.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/235_keccak256_with_large_integer_constant.sol7
-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/248_tuple_assignment_from_void_function.sol11
-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/406_invalid_address_checksum.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/407_invalid_address_no_checksum.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/408_invalid_address_length_short.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/409_invalid_address_length_long.sol3
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/413_address_methods.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/415_interface_functions.sol8
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/424_using_interface_complex.sol12
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/463_error_transfer_non_payable_fallback.sol8
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/464_error_transfer_no_fallback.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/465_error_send_non_payable_fallback.sol8
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/466_does_not_error_transfer_payable_fallback.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/467_does_not_error_transfer_regular_function.sol2
-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/493_builtin_keccak256_reject_gas.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/494_builtin_sha256_reject_gas.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/495_builtin_ripemd160_reject_gas.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/502_builtin_keccak256_reject_value.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/503_builtin_sha256_reject_value.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/504_builtin_ripemd160_reject_value.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/526_fallback_marked_external.sol3
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/527_fallback_marked_internal.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/535_address_overload_resolution.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/563_event_without_emit_deprecated.sol2
-rw-r--r--test/libsolidity/syntaxTests/parsing/else_if_statement.sol6
-rw-r--r--test/libsolidity/syntaxTests/parsing/fallback_function.sol3
-rw-r--r--test/libsolidity/syntaxTests/parsing/if_statement.sol10
-rw-r--r--test/libsolidity/syntaxTests/parsing/modifier.sol2
-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/specialFunctions/single_non_bytes_arg.sol9
-rw-r--r--test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol14
-rw-r--r--test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol7
-rw-r--r--test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs_abiv2.sol7
-rw-r--r--test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_types.sol13
-rw-r--r--test/libsolidity/syntaxTests/tight_packing_literals.sol20
-rw-r--r--test/libsolidity/syntaxTests/tight_packing_literals_050.sol27
-rw-r--r--test/libsolidity/syntaxTests/tight_packing_literals_fine.sol15
-rw-r--r--test/libsolidity/syntaxTests/tupleAssignments/warn_fill_vardecl.sol7
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_event.sol5
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_event_050.sol10
-rw-r--r--test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol8
129 files changed, 473 insertions, 755 deletions
diff --git a/test/libsolidity/ABIEncoderTests.cpp b/test/libsolidity/ABIEncoderTests.cpp
index 227eadb5..9b6250d8 100644
--- a/test/libsolidity/ABIEncoderTests.cpp
+++ b/test/libsolidity/ABIEncoderTests.cpp
@@ -68,7 +68,7 @@ BOOST_AUTO_TEST_CASE(value_types)
assembly { b := 7 }
C c;
assembly { c := sub(0, 5) }
- E(10, uint16(uint256(-2)), uint24(0x12121212), int24(int256(-1)), bytes3(x), b, c);
+ emit E(10, uint16(uint256(-2)), uint24(0x12121212), int24(int256(-1)), bytes3(x), b, c);
}
}
)";
@@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE(string_literal)
contract C {
event E(string, bytes20, string);
function f() public {
- E("abcdef", "abcde", "abcdefabcdefgehabcabcasdfjklabcdefabcedefghabcabcasdfjklabcdefabcdefghabcabcasdfjklabcdeefabcdefghabcabcasdefjklabcdefabcdefghabcabcasdfjkl");
+ emit E("abcdef", "abcde", "abcdefabcdefgehabcabcasdfjklabcdefabcedefghabcabcasdfjklabcdefabcdefghabcabcasdfjklabcdeefabcdefghabcabcasdefjklabcdefabcdefghabcabcasdfjkl");
}
}
)";
@@ -133,7 +133,7 @@ BOOST_AUTO_TEST_CASE(conversion)
int8 c;
int16 d;
assembly { a := sub(0, 1) c := 0x0101ff d := 0xff01 }
- E(10, x, a, uint8(b), c, int8(d));
+ emit E(10, x, a, uint8(b), c, int8(d));
}
}
)";
@@ -159,7 +159,7 @@ BOOST_AUTO_TEST_CASE(memory_array_one_dim)
mstore(add(x, mul(add(i, 1), 0x20)), add(0xfffffffe, i))
}
}
- E(10, x, 11);
+ emit E(10, x, 11);
}
}
)";
@@ -188,7 +188,7 @@ BOOST_AUTO_TEST_CASE(memory_array_two_dim)
x[0][2] = -1;
x[1][0] = 4;
x[1][1] = 5;
- E(10, x, 11);
+ emit E(10, x, 11);
}
}
)";
@@ -208,7 +208,7 @@ BOOST_AUTO_TEST_CASE(memory_byte_array)
bytes[] memory x = new bytes[](2);
x[0] = "abcabcdefghjklmnopqrsuvwabcdefgijklmnopqrstuwabcdefgijklmnoprstuvw";
x[1] = "abcdefghijklmnopqrtuvwabcfghijklmnopqstuvwabcdeghijklmopqrstuvw";
- E(10, x, 11);
+ emit E(10, x, 11);
}
}
)";
@@ -234,7 +234,7 @@ BOOST_AUTO_TEST_CASE(storage_byte_array)
function f() public {
short = "123456789012345678901234567890a";
long = "ffff123456789012345678901234567890afffffffff123456789012345678901234567890a";
- E(short, long);
+ emit E(short, long);
}
}
)";
@@ -261,7 +261,7 @@ BOOST_AUTO_TEST_CASE(storage_array)
sstore(1, sub(0, 2))
sstore(2, sub(0, 3))
}
- E(addr);
+ emit E(addr);
}
}
)";
@@ -279,10 +279,10 @@ BOOST_AUTO_TEST_CASE(storage_array_dyn)
address[] addr;
event E(address[] a);
function f() public {
- addr.push(1);
- addr.push(2);
- addr.push(3);
- E(addr);
+ addr.push(0x0000000000000000000000000000000000000001);
+ addr.push(0x0000000000000000000000000000000000000002);
+ addr.push(0x0000000000000000000000000000000000000003);
+ emit E(addr);
}
}
)";
@@ -308,7 +308,7 @@ BOOST_AUTO_TEST_CASE(storage_array_compact)
x.push(6);
x.push(-7);
x.push(8);
- E(x);
+ emit E(x);
}
}
)";
@@ -329,7 +329,7 @@ BOOST_AUTO_TEST_CASE(external_function)
function(uint) external returns (uint) g;
function f(uint) public returns (uint) {
g = this.f;
- E(this.f, g);
+ emit E(this.f, g);
}
}
)";
@@ -351,7 +351,7 @@ BOOST_AUTO_TEST_CASE(external_function_cleanup)
function f(uint) public returns (uint) {
function(uint) external returns (uint)[1] memory h;
assembly { sstore(0, sub(0, 1)) mstore(h, sub(0, 1)) }
- E(h[0], g);
+ emit E(h[0], g);
}
}
)";
@@ -368,7 +368,7 @@ BOOST_AUTO_TEST_CASE(calldata)
contract C {
event E(bytes);
function f(bytes a) external {
- E(a);
+ emit E(a);
}
}
)";
@@ -426,7 +426,7 @@ BOOST_AUTO_TEST_CASE(structs)
s.sub[0].x[0] = 11;
s.sub[1].x[0] = 12;
s.sub[2].x[1] = 13;
- e(x, s);
+ emit e(x, s);
return (x, s);
}
}
diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp
index f16d9abe..b0cd5a93 100644
--- a/test/libsolidity/GasMeter.cpp
+++ b/test/libsolidity/GasMeter.cpp
@@ -152,7 +152,7 @@ BOOST_AUTO_TEST_CASE(simple_contract)
contract test {
bytes32 public shaValue;
function f(uint a) {
- shaValue = keccak256(a);
+ shaValue = keccak256(abi.encodePacked(a));
}
}
)";
@@ -165,7 +165,7 @@ BOOST_AUTO_TEST_CASE(store_keccak256)
contract test {
bytes32 public shaValue;
function test(uint a) {
- shaValue = keccak256(a);
+ shaValue = keccak256(abi.encodePacked(a));
}
}
)";
@@ -301,7 +301,7 @@ BOOST_AUTO_TEST_CASE(regular_functions_exclude_fallback)
char const* sourceCode = R"(
contract A {
uint public x;
- function() { x = 2; }
+ function() external { x = 2; }
}
)";
testCreationTimeGas(sourceCode);
diff --git a/test/libsolidity/Imports.cpp b/test/libsolidity/Imports.cpp
index 1b5dd4a5..4b700ceb 100644
--- a/test/libsolidity/Imports.cpp
+++ b/test/libsolidity/Imports.cpp
@@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE(simple_alias)
{
CompilerStack c;
c.addSource("a", "contract A {} pragma solidity >=0.0;");
- c.addSource("dir/a/b/c", "import \"../../.././a\" as x; contract B is x.A { function() { x.A r = x.A(20); } } pragma solidity >=0.0;");
+ c.addSource("dir/a/b/c", "import \"../../.././a\" as x; contract B is x.A { function() external { x.A r = x.A(20); } } pragma solidity >=0.0;");
c.setEVMVersion(dev::test::Options::get().evmVersion());
BOOST_CHECK(c.compile());
}
diff --git a/test/libsolidity/SMTChecker.cpp b/test/libsolidity/SMTChecker.cpp
index 18c8c025..57f414db 100644
--- a/test/libsolidity/SMTChecker.cpp
+++ b/test/libsolidity/SMTChecker.cpp
@@ -433,15 +433,15 @@ BOOST_AUTO_TEST_CASE(storage_value_vars)
function f(uint x) public {
if (x == 0)
{
- a = 100;
+ a = 0x0000000000000000000000000000000000000100;
b = true;
}
else
{
- a = 200;
+ a = 0x0000000000000000000000000000000000000200;
b = false;
}
- assert(a > 0 && b);
+ assert(a > 0x0000000000000000000000000000000000000000 && b);
}
}
)";
@@ -464,19 +464,19 @@ BOOST_AUTO_TEST_CASE(storage_value_vars)
function f(uint x) public {
if (x == 0)
{
- a = 100;
+ a = 0x0000000000000000000000000000000000000100;
b = true;
}
else
{
- a = 200;
+ a = 0x0000000000000000000000000000000000000200;
b = false;
}
- assert(b == (a < 200));
+ assert(b == (a < 0x0000000000000000000000000000000000000200));
}
function g() public view {
- require(a < 100);
+ require(a < 0x0000000000000000000000000000000000000100);
assert(c >= 0);
}
address a;
diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp
index 107abc26..b1c8e567 100644
--- a/test/libsolidity/SolidityABIJSON.cpp
+++ b/test/libsolidity/SolidityABIJSON.cpp
@@ -843,7 +843,7 @@ BOOST_AUTO_TEST_CASE(include_fallback_function)
{
char const* sourceCode = R"(
contract test {
- function() {}
+ function() external {}
}
)";
@@ -897,7 +897,7 @@ BOOST_AUTO_TEST_CASE(payable_fallback_function)
{
char const* sourceCode = R"(
contract test {
- function () payable {}
+ function () external payable {}
}
)";
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 65473f0d..b8c85a63 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -1456,7 +1456,7 @@ BOOST_AUTO_TEST_CASE(multiple_elementary_accessors)
function test() {
data = 8;
name = "Celina";
- a_hash = keccak256(123);
+ a_hash = keccak256("\x7b");
an_address = address(0x1337);
super_secret_data = 42;
}
@@ -1812,7 +1812,7 @@ BOOST_AUTO_TEST_CASE(transfer_ether)
}
contract C {
- function () payable {
+ function () external payable {
throw;
}
}
@@ -1992,7 +1992,7 @@ BOOST_AUTO_TEST_CASE(keccak256)
char const* sourceCode = R"(
contract test {
function a(bytes32 input) returns (bytes32 hash) {
- return keccak256(input);
+ return keccak256(abi.encodePacked(input));
}
}
)";
@@ -2011,7 +2011,7 @@ BOOST_AUTO_TEST_CASE(sha256)
char const* sourceCode = R"(
contract test {
function a(bytes32 input) returns (bytes32 sha256hash) {
- return sha256(input);
+ return sha256(abi.encodePacked(input));
}
}
)";
@@ -2036,7 +2036,7 @@ BOOST_AUTO_TEST_CASE(ripemd)
char const* sourceCode = R"(
contract test {
function a(bytes32 input) returns (bytes32 sha256hash) {
- return ripemd160(input);
+ return ripemd160(abi.encodePacked(input));
}
}
)";
@@ -2063,7 +2063,7 @@ BOOST_AUTO_TEST_CASE(packed_keccak256)
function a(bytes32 input) returns (bytes32 hash) {
var b = 65536;
uint c = 256;
- return keccak256(8, input, b, input, c);
+ return keccak256(abi.encodePacked(8, input, b, input, c));
}
}
)";
@@ -2093,9 +2093,9 @@ BOOST_AUTO_TEST_CASE(packed_keccak256_complex_types)
x[0] = y[0] = uint120(-2);
x[1] = y[1] = uint120(-3);
x[2] = y[2] = uint120(-4);
- hash1 = keccak256(x);
- hash2 = keccak256(y);
- hash3 = keccak256(this.f);
+ hash1 = keccak256(abi.encodePacked(x));
+ hash2 = keccak256(abi.encodePacked(y));
+ hash3 = keccak256(abi.encodePacked(this.f));
}
}
)";
@@ -2115,7 +2115,7 @@ BOOST_AUTO_TEST_CASE(packed_sha256)
function a(bytes32 input) returns (bytes32 hash) {
var b = 65536;
uint c = 256;
- return sha256(8, input, b, input, c);
+ return sha256(abi.encodePacked(8, input, b, input, c));
}
}
)";
@@ -2142,7 +2142,7 @@ BOOST_AUTO_TEST_CASE(packed_ripemd160)
function a(bytes32 input) returns (bytes32 hash) {
var b = 65536;
uint c = 256;
- return ripemd160(8, input, b, input, c);
+ return ripemd160(abi.encodePacked(8, input, b, input, c));
}
}
)";
@@ -2506,7 +2506,7 @@ BOOST_AUTO_TEST_CASE(contracts_as_addresses)
{
char const* sourceCode = R"(
contract helper {
- function() payable { } // can receive ether
+ function() external payable { } // can receive ether
}
contract test {
helper h;
@@ -3054,7 +3054,7 @@ BOOST_AUTO_TEST_CASE(fallback_function)
char const* sourceCode = R"(
contract A {
uint data;
- function() { data = 1; }
+ function() external { data = 1; }
function getData() returns (uint r) { return data; }
}
)";
@@ -3069,7 +3069,7 @@ BOOST_AUTO_TEST_CASE(inherited_fallback_function)
char const* sourceCode = R"(
contract A {
uint data;
- function() { data = 1; }
+ function() external { data = 1; }
function getData() returns (uint r) { return data; }
}
contract B is A {}
@@ -3082,13 +3082,13 @@ BOOST_AUTO_TEST_CASE(inherited_fallback_function)
BOOST_AUTO_TEST_CASE(default_fallback_throws)
{
- char const* sourceCode = R"(
+ char const* sourceCode = R"YY(
contract A {
function f() returns (bool) {
- return this.call();
+ return this.call("");
}
}
- )";
+ )YY";
compileAndRun(sourceCode);
ABI_CHECK(callContractFunction("f()"), encodeArgs(0));
}
@@ -3100,7 +3100,7 @@ BOOST_AUTO_TEST_CASE(short_data_calls_fallback)
uint public x;
// Signature is d88e0b00
function fow() { x = 3; }
- function () { x = 2; }
+ function () external { x = 2; }
}
)";
compileAndRun(sourceCode);
@@ -3122,7 +3122,7 @@ BOOST_AUTO_TEST_CASE(event)
bytes32 s = 0x19dacbf83c5de6658e14cbf7bcae5c15eca2eedecf1c66fbca928e4d351bea0f;
log3(bytes32(msg.value), s, bytes32(uint256(msg.sender)), _id);
} else {
- Deposit(msg.sender, _id, msg.value);
+ emit Deposit(msg.sender, _id, msg.value);
}
}
}
@@ -3172,7 +3172,7 @@ BOOST_AUTO_TEST_CASE(event_no_arguments)
contract ClientReceipt {
event Deposit();
function deposit() {
- Deposit();
+ emit Deposit();
}
}
)";
@@ -3186,28 +3186,6 @@ BOOST_AUTO_TEST_CASE(event_no_arguments)
BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::keccak256(string("Deposit()")));
}
-BOOST_AUTO_TEST_CASE(event_access_through_base_name)
-{
- char const* sourceCode = R"(
- contract A {
- event x();
- }
- contract B is A {
- function f() returns (uint) {
- A.x();
- return 1;
- }
- }
- )";
- compileAndRun(sourceCode);
- callContractFunction("f()");
- BOOST_REQUIRE_EQUAL(m_logs.size(), 1);
- BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress);
- BOOST_CHECK(m_logs[0].data.empty());
- BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 1);
- BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::keccak256(string("x()")));
-}
-
BOOST_AUTO_TEST_CASE(event_access_through_base_name_emit)
{
char const* sourceCode = R"(
@@ -3238,67 +3216,15 @@ BOOST_AUTO_TEST_CASE(events_with_same_name)
event Deposit(address _addr);
event Deposit(address _addr, uint _amount);
function deposit() returns (uint) {
- Deposit();
- return 1;
- }
- function deposit(address _addr) returns (uint) {
- Deposit(_addr);
- return 1;
- }
- function deposit(address _addr, uint _amount) returns (uint) {
- Deposit(_addr, _amount);
- return 1;
- }
- }
- )";
- u160 const c_loggedAddress = m_contractAddress;
-
- compileAndRun(sourceCode);
- ABI_CHECK(callContractFunction("deposit()"), encodeArgs(u256(1)));
- BOOST_REQUIRE_EQUAL(m_logs.size(), 1);
- BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress);
- BOOST_CHECK(m_logs[0].data.empty());
- BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 1);
- BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::keccak256(string("Deposit()")));
-
- ABI_CHECK(callContractFunction("deposit(address)", c_loggedAddress), encodeArgs(u256(1)));
- BOOST_REQUIRE_EQUAL(m_logs.size(), 1);
- BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress);
- BOOST_CHECK(m_logs[0].data == encodeArgs(c_loggedAddress));
- BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 1);
- BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::keccak256(string("Deposit(address)")));
-
- ABI_CHECK(callContractFunction("deposit(address,uint256)", c_loggedAddress, u256(100)), encodeArgs(u256(1)));
- BOOST_REQUIRE_EQUAL(m_logs.size(), 1);
- BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress);
- BOOST_CHECK(m_logs[0].data == encodeArgs(c_loggedAddress, 100));
- BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 1);
- BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::keccak256(string("Deposit(address,uint256)")));
-}
-
-BOOST_AUTO_TEST_CASE(events_with_same_name_inherited)
-{
- char const* sourceCode = R"(
- contract A {
- event Deposit();
- }
-
- contract B {
- event Deposit(address _addr);
- }
-
- contract ClientReceipt is A, B {
- event Deposit(address _addr, uint _amount);
- function deposit() returns (uint) {
- Deposit();
+ emit Deposit();
return 1;
}
function deposit(address _addr) returns (uint) {
- Deposit(_addr);
+ emit Deposit(_addr);
return 1;
}
function deposit(address _addr, uint _amount) returns (uint) {
- Deposit(_addr, _amount);
+ emit Deposit(_addr, _amount);
return 1;
}
}
@@ -3386,7 +3312,7 @@ BOOST_AUTO_TEST_CASE(event_anonymous)
contract ClientReceipt {
event Deposit() anonymous;
function deposit() {
- Deposit();
+ emit Deposit();
}
}
)";
@@ -3401,7 +3327,7 @@ BOOST_AUTO_TEST_CASE(event_anonymous_with_topics)
contract ClientReceipt {
event Deposit(address indexed _from, bytes32 indexed _id, uint indexed _value, uint indexed _value2, bytes32 data) anonymous;
function deposit(bytes32 _id) payable {
- Deposit(msg.sender, _id, msg.value, 2, "abc");
+ emit Deposit(msg.sender, _id, msg.value, 2, "abc");
}
}
)";
@@ -3425,7 +3351,7 @@ BOOST_AUTO_TEST_CASE(event_lots_of_data)
contract ClientReceipt {
event Deposit(address _from, bytes32 _id, uint _value, bool _flag);
function deposit(bytes32 _id) payable {
- Deposit(msg.sender, _id, msg.value, true);
+ emit Deposit(msg.sender, _id, msg.value, true);
}
}
)";
@@ -3446,7 +3372,7 @@ BOOST_AUTO_TEST_CASE(event_really_lots_of_data)
contract ClientReceipt {
event Deposit(uint fixeda, bytes dynx, uint fixedb);
function deposit() {
- Deposit(10, msg.data, 15);
+ emit Deposit(10, msg.data, 15);
}
}
)";
@@ -3470,7 +3396,7 @@ BOOST_AUTO_TEST_CASE(event_really_lots_of_data_from_storage)
x[0] = "A";
x[1] = "B";
x[2] = "C";
- Deposit(10, x, 15);
+ emit Deposit(10, x, 15);
}
}
)";
@@ -3495,7 +3421,7 @@ BOOST_AUTO_TEST_CASE(event_really_really_lots_of_data_from_storage)
x[1] = "B";
x[2] = "C";
x[30] = "Z";
- Deposit(10, x, 15);
+ emit Deposit(10, x, 15);
}
}
)";
@@ -3523,7 +3449,7 @@ BOOST_AUTO_TEST_CASE(event_indexed_string)
y[1] = 5;
y[2] = 6;
y[3] = 7;
- E(x, y);
+ emit E(x, y);
}
}
)";
@@ -3577,7 +3503,7 @@ BOOST_AUTO_TEST_CASE(sha256_empty)
char const* sourceCode = R"(
contract C {
function f() returns (bytes32) {
- return sha256();
+ return sha256("");
}
}
)";
@@ -3590,7 +3516,7 @@ BOOST_AUTO_TEST_CASE(ripemd160_empty)
char const* sourceCode = R"(
contract C {
function f() returns (bytes20) {
- return ripemd160();
+ return ripemd160("");
}
}
)";
@@ -3603,7 +3529,7 @@ BOOST_AUTO_TEST_CASE(keccak256_empty)
char const* sourceCode = R"(
contract C {
function f() returns (bytes32) {
- return keccak256();
+ return keccak256("");
}
}
)";
@@ -3617,7 +3543,7 @@ BOOST_AUTO_TEST_CASE(keccak256_multiple_arguments)
contract c {
function foo(uint a, uint b, uint c) returns (bytes32 d)
{
- d = keccak256(a, b, c);
+ d = keccak256(abi.encodePacked(a, b, c));
}
}
)";
@@ -3638,7 +3564,7 @@ BOOST_AUTO_TEST_CASE(keccak256_multiple_arguments_with_numeric_literals)
contract c {
function foo(uint a, uint16 b) returns (bytes32 d)
{
- d = keccak256(a, b, 145);
+ d = keccak256(abi.encodePacked(a, b, 145));
}
}
)";
@@ -3663,7 +3589,7 @@ BOOST_AUTO_TEST_CASE(keccak256_multiple_arguments_with_string_literals)
}
function bar(uint a, uint16 b) returns (bytes32 d)
{
- d = keccak256(a, b, 145, "foo");
+ d = keccak256(abi.encodePacked(a, b, 145, "foo"));
}
}
)";
@@ -3702,7 +3628,7 @@ BOOST_AUTO_TEST_CASE(keccak256_with_bytes)
BOOST_AUTO_TEST_CASE(iterated_keccak256_with_bytes)
{
- char const* sourceCode = R"(
+ char const* sourceCode = R"ABC(
contract c {
bytes data;
function foo() returns (bytes32)
@@ -3711,10 +3637,10 @@ BOOST_AUTO_TEST_CASE(iterated_keccak256_with_bytes)
data[0] = "x";
data[1] = "y";
data[2] = "z";
- return keccak256("b", keccak256(data), "a");
+ return keccak256(abi.encodePacked("b", keccak256(data), "a"));
}
}
- )";
+ )ABC";
compileAndRun(sourceCode);
ABI_CHECK(callContractFunction("foo()"), encodeArgs(
u256(dev::keccak256(bytes{'b'} + dev::keccak256("xyz").asBytes() + bytes{'a'}))
@@ -3733,7 +3659,7 @@ BOOST_AUTO_TEST_CASE(generic_call)
function doSend(address rec) returns (uint d)
{
bytes4 signature = bytes4(bytes32(keccak256("receive(uint256)")));
- rec.call.value(2)(signature, 23);
+ rec.call.value(2)(abi.encodeWithSelector(signature, 23));
return receiver(rec).received();
}
}
@@ -3763,7 +3689,7 @@ BOOST_AUTO_TEST_CASE(generic_delegatecall)
function doSend(address rec) payable
{
bytes4 signature = bytes4(bytes32(keccak256("receive(uint256)")));
- if (rec.delegatecall(signature, 23)) {}
+ if (rec.delegatecall(abi.encodeWithSelector(signature, 23))) {}
}
}
)**";
@@ -3860,7 +3786,7 @@ BOOST_AUTO_TEST_CASE(bytes_from_calldata_to_memory)
char const* sourceCode = R"(
contract C {
function f() returns (bytes32) {
- return keccak256("abc", msg.data);
+ return keccak256(abi.encodePacked("abc", msg.data));
}
}
)";
@@ -3876,11 +3802,11 @@ BOOST_AUTO_TEST_CASE(call_forward_bytes)
contract receiver {
uint public received;
function receive(uint x) { received += x + 1; }
- function() { received = 0x80; }
+ function() external { received = 0x80; }
}
contract sender {
function sender() { rec = new receiver(); }
- function() { savedData = msg.data; }
+ function() external { savedData = msg.data; }
function forward() returns (bool) { !rec.call(savedData); return true; }
function clear() returns (bool) { delete savedData; return true; }
function val() returns (uint) { return rec.received(); }
@@ -3904,7 +3830,7 @@ BOOST_AUTO_TEST_CASE(call_forward_bytes_length)
char const* sourceCode = R"(
contract receiver {
uint public calledLength;
- function() { calledLength = msg.data.length; }
+ function() external { calledLength = msg.data.length; }
}
contract sender {
receiver rec;
@@ -3929,21 +3855,15 @@ BOOST_AUTO_TEST_CASE(call_forward_bytes_length)
compileAndRun(sourceCode, 0, "sender");
// No additional data, just function selector
- ABI_CHECK(callContractFunction("viaCalldata()"), encodeArgs(0x20));
- // Should be this with 0.5.0: encodeArgs(4));
- ABI_CHECK(callContractFunction("viaMemory()"), encodeArgs(0x20));
- // Should be this with 0.5.0: encodeArgs(4));
- ABI_CHECK(callContractFunction("viaStorage()"), encodeArgs(0x20));
- // Should be this with 0.5.0: encodeArgs(4));
+ ABI_CHECK(callContractFunction("viaCalldata()"), encodeArgs(4));
+ ABI_CHECK(callContractFunction("viaMemory()"), encodeArgs(4));
+ ABI_CHECK(callContractFunction("viaStorage()"), encodeArgs(4));
// Some additional unpadded data
bytes unpadded = asBytes(string("abc"));
- ABI_CHECK(callContractFunctionNoEncoding("viaCalldata()", unpadded), encodeArgs(0x20));
- // Should be this with 0.5.0: encodeArgs(7));
- ABI_CHECK(callContractFunctionNoEncoding("viaMemory()", unpadded), encodeArgs(0x20));
- // Should be this with 0.5.0: encodeArgs(7));
- ABI_CHECK(callContractFunctionNoEncoding("viaStorage()", unpadded), encodeArgs(0x20));
- // Should be this with 0.5.0: encodeArgs(7));
+ ABI_CHECK(callContractFunctionNoEncoding("viaCalldata()", unpadded), encodeArgs(7));
+ ABI_CHECK(callContractFunctionNoEncoding("viaMemory()", unpadded), encodeArgs(7));
+ ABI_CHECK(callContractFunctionNoEncoding("viaStorage()", unpadded), encodeArgs(7));
}
BOOST_AUTO_TEST_CASE(copying_bytes_multiassign)
@@ -3952,11 +3872,11 @@ BOOST_AUTO_TEST_CASE(copying_bytes_multiassign)
contract receiver {
uint public received;
function receive(uint x) { received += x + 1; }
- function() { received = 0x80; }
+ function() external { received = 0x80; }
}
contract sender {
function sender() { rec = new receiver(); }
- function() { savedData1 = savedData2 = msg.data; }
+ function() external { savedData1 = savedData2 = msg.data; }
function forward(bool selector) returns (bool) {
if (selector) { rec.call(savedData1); delete savedData1; }
else { rec.call(savedData2); delete savedData2; }
@@ -3983,7 +3903,7 @@ BOOST_AUTO_TEST_CASE(delete_removes_bytes_data)
{
char const* sourceCode = R"(
contract c {
- function() { data = msg.data; }
+ function() external { data = msg.data; }
function del() returns (bool) { delete data; return true; }
bytes data;
}
@@ -4000,7 +3920,7 @@ BOOST_AUTO_TEST_CASE(copy_from_calldata_removes_bytes_data)
char const* sourceCode = R"(
contract c {
function set() returns (bool) { data = msg.data; return true; }
- function() { data = msg.data; }
+ function() external { data = msg.data; }
bytes data;
}
)";
@@ -4246,7 +4166,7 @@ BOOST_AUTO_TEST_CASE(storing_invalid_boolean)
assembly {
tmp := 5
}
- Ev(tmp);
+ emit Ev(tmp);
return 1;
}
}
@@ -6034,12 +5954,12 @@ BOOST_AUTO_TEST_CASE(invalid_enum_logged)
assembly {
garbled := 5
}
- Log(garbled);
+ emit Log(garbled);
return 1;
}
function test_log_ok() returns (uint) {
X x = X.A;
- Log(x);
+ emit Log(x);
return 1;
}
}
@@ -6345,7 +6265,7 @@ BOOST_AUTO_TEST_CASE(failing_send)
char const* sourceCode = R"(
contract Helper {
uint[] data;
- function () {
+ function () external {
data[9]; // trigger exception
}
}
@@ -6369,7 +6289,7 @@ BOOST_AUTO_TEST_CASE(send_zero_ether)
// (it previously did not because the gas stipend was not provided by the EVM)
char const* sourceCode = R"(
contract Receiver {
- function () payable {
+ function () external payable {
}
}
contract Main {
@@ -6398,7 +6318,7 @@ BOOST_AUTO_TEST_CASE(reusing_memory)
mapping(uint => uint) map;
function f(uint x) returns (uint) {
map[x] = x;
- return (new Helper(uint(keccak256(this.g(map[x]))))).flag();
+ return (new Helper(uint(keccak256(abi.encodePacked(this.g(map[x])))))).flag();
}
function g(uint a) returns (uint)
{
@@ -7885,7 +7805,7 @@ BOOST_AUTO_TEST_CASE(reject_ether_sent_to_library)
function f(address x) returns (bool) {
return x.send(1);
}
- function () payable {}
+ function () external payable {}
}
)";
compileAndRun(sourceCode, 0, "lib");
@@ -9386,7 +9306,7 @@ BOOST_AUTO_TEST_CASE(mutex)
// NOTE: It is very bad practice to write this function this way.
// Please refer to the documentation of how to do this properly.
if (amount > shares) throw;
- if (!msg.sender.call.value(amount)()) throw;
+ if (!msg.sender.call.value(amount)("")) throw;
shares -= amount;
return shares;
}
@@ -9394,7 +9314,7 @@ BOOST_AUTO_TEST_CASE(mutex)
// NOTE: It is very bad practice to write this function this way.
// Please refer to the documentation of how to do this properly.
if (amount > shares) throw;
- if (!msg.sender.call.value(amount)()) throw;
+ if (!msg.sender.call.value(amount)("")) throw;
shares -= amount;
return shares;
}
@@ -9415,7 +9335,7 @@ BOOST_AUTO_TEST_CASE(mutex)
else
return fund.withdrawUnprotected(10);
}
- function() payable {
+ function() external payable {
callDepth++;
if (callDepth < 4)
attackInternal();
@@ -9460,14 +9380,14 @@ BOOST_AUTO_TEST_CASE(failing_ecrecover_invalid_input_proper)
0, // invalid v value
0x6944c77849b18048f6abe0db8084b0d0d0689cdddb53d2671c36967b58691ad4,
0xef4f06ba4f78319baafd0424365777241af4dfd3da840471b4b4b087b7750d0d,
- 0xca35b7d915458ef540ade6068dfe2f44e8fa733c,
- 0xca35b7d915458ef540ade6068dfe2f44e8fa733c
+ 0x00ca35b7d915458ef540ade6068dfe2f44e8fa733c,
+ 0x00ca35b7d915458ef540ade6068dfe2f44e8fa733c
);
}
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s, uint blockExpired, bytes32 salt)
returns (address)
{
- require(hash == keccak256(blockExpired, salt));
+ require(hash == keccak256(abi.encodePacked(blockExpired, salt)));
return ecrecover(hash, v, r, s);
}
}
@@ -9499,7 +9419,7 @@ BOOST_AUTO_TEST_CASE(failing_ecrecover_invalid_input_asm)
BOOST_AUTO_TEST_CASE(calling_nonexisting_contract_throws)
{
- char const* sourceCode = R"(
+ char const* sourceCode = R"YY(
contract D { function g(); }
contract C {
D d = D(0x1212);
@@ -9512,11 +9432,11 @@ BOOST_AUTO_TEST_CASE(calling_nonexisting_contract_throws)
return 7;
}
function h() returns (uint) {
- d.call(); // this does not throw (low-level)
+ d.call(""); // this does not throw (low-level)
return 7;
}
}
- )";
+ )YY";
compileAndRun(sourceCode, 0, "C");
ABI_CHECK(callContractFunction("f()"), encodeArgs());
ABI_CHECK(callContractFunction("g()"), encodeArgs());
@@ -9541,7 +9461,7 @@ BOOST_AUTO_TEST_CASE(payable_function)
function f() payable returns (uint) {
return msg.value;
}
- function() payable {
+ function() external payable {
a = msg.value + 1;
}
}
@@ -9580,7 +9500,7 @@ BOOST_AUTO_TEST_CASE(non_payable_throw)
function f() returns (uint) {
return msg.value;
}
- function() {
+ function() external {
a = msg.value + 1;
}
}
@@ -11269,7 +11189,7 @@ BOOST_AUTO_TEST_CASE(bubble_up_error_messages_through_transfer)
{
char const* sourceCode = R"(
contract D {
- function() public payable {
+ function() external payable {
revert("message");
}
function f() public {
@@ -11420,7 +11340,7 @@ BOOST_AUTO_TEST_CASE(interface_contract)
interface I {
event A();
function f() returns (bool);
- function() payable;
+ function() external payable;
}
contract A is I {
@@ -11432,7 +11352,7 @@ BOOST_AUTO_TEST_CASE(interface_contract)
return true;
}
- function() payable {
+ function() external payable {
}
}
@@ -11520,17 +11440,17 @@ BOOST_AUTO_TEST_CASE(inlineasm_empty_let)
BOOST_AUTO_TEST_CASE(bare_call_invalid_address)
{
- char const* sourceCode = R"(
+ char const* sourceCode = R"YY(
contract C {
/// Calling into non-existant account is successful (creates the account)
function f() external returns (bool) {
- return address(0x4242).call();
+ return address(0x4242).call("");
}
function h() external returns (bool) {
- return address(0x4242).delegatecall();
+ return address(0x4242).delegatecall("");
}
}
- )";
+ )YY";
compileAndRun(sourceCode, 0, "C");
ABI_CHECK(callContractFunction("f()"), encodeArgs(u256(1)));
ABI_CHECK(callContractFunction("h()"), encodeArgs(u256(1)));
@@ -11548,13 +11468,13 @@ BOOST_AUTO_TEST_CASE(delegatecall_return_value)
return value;
}
function get_delegated() external returns (bool) {
- return this.delegatecall(bytes4(keccak256("get()")));
+ return this.delegatecall(abi.encodeWithSignature("get()"));
}
function assert0() external view {
assert(value == 0);
}
function assert0_delegated() external returns (bool) {
- return this.delegatecall(bytes4(keccak256("assert0()")));
+ return this.delegatecall(abi.encodeWithSignature("assert0()"));
}
}
)DELIMITER";
@@ -11932,7 +11852,7 @@ BOOST_AUTO_TEST_CASE(snark)
input[7] = 9643208548031422463313148630985736896287522941726746581856185889848792022807;
input[8] = 18066496933330839731877828156604;
if (verify(input, proof) == 0) {
- Verified("Transaction successfully verified.");
+ emit Verified("Transaction successfully verified.");
return true;
} else {
return false;
diff --git a/test/libsolidity/SolidityExpressionCompiler.cpp b/test/libsolidity/SolidityExpressionCompiler.cpp
index ad26ce6b..ce8f4fe4 100644
--- a/test/libsolidity/SolidityExpressionCompiler.cpp
+++ b/test/libsolidity/SolidityExpressionCompiler.cpp
@@ -490,7 +490,7 @@ BOOST_AUTO_TEST_CASE(intermediately_overflowing_literals)
// have been applied
char const* sourceCode = R"(
contract test {
- function f() { var x = (0xffffffffffffffffffffffffffffffffffffffff * 0xffffffffffffffffffffffffff01) & 0xbf; }
+ function f() { var x = (0x00ffffffffffffffffffffffffffffffffffffffff * 0xffffffffffffffffffffffffff01) & 0xbf; }
}
)";
bytes code = compileFirstExpression(sourceCode);
diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp
index 3a8585f7..4ea307c0 100644
--- a/test/libsolidity/SolidityOptimizer.cpp
+++ b/test/libsolidity/SolidityOptimizer.cpp
@@ -265,18 +265,18 @@ BOOST_AUTO_TEST_CASE(storage_write_in_loops)
// Information in joining branches is not retained anymore.
BOOST_AUTO_TEST_CASE(retain_information_in_branches)
{
- // This tests that the optimizer knows that we already have "z == keccak256(y)" inside both branches.
+ // This tests that the optimizer knows that we already have "z == keccak256(abi.encodePacked(y))" inside both branches.
char const* sourceCode = R"(
contract c {
bytes32 d;
uint a;
function f(uint x, bytes32 y) returns (uint r_a, bytes32 r_d) {
- bytes32 z = keccak256(y);
+ bytes32 z = keccak256(abi.encodePacked(y));
if (x > 8) {
- z = keccak256(y);
+ z = keccak256(abi.encodePacked(y));
a = x;
} else {
- z = keccak256(y);
+ z = keccak256(abi.encodePacked(y));
a = x;
}
r_a = a;
@@ -313,19 +313,19 @@ BOOST_AUTO_TEST_CASE(store_tags_as_unions)
contract test {
bytes32 data;
function f(uint x, bytes32 y) external returns (uint r_a, bytes32 r_d) {
- r_d = keccak256(y);
+ r_d = keccak256(abi.encodePacked(y));
shared(y);
- r_d = keccak256(y);
+ r_d = keccak256(abi.encodePacked(y));
r_a = 5;
}
function g(uint x, bytes32 y) external returns (uint r_a, bytes32 r_d) {
- r_d = keccak256(y);
+ r_d = keccak256(abi.encodePacked(y));
shared(y);
- r_d = bytes32(uint(keccak256(y)) + 2);
+ r_d = bytes32(uint(keccak256(abi.encodePacked(y))) + 2);
r_a = 7;
}
function shared(bytes32 y) internal {
- data = keccak256(y);
+ data = keccak256(abi.encodePacked(y));
}
}
)";
@@ -370,7 +370,7 @@ BOOST_AUTO_TEST_CASE(sequence_number_for_calls)
// to storage), so the sequence number should be incremented.
char const* sourceCode = R"(
contract test {
- function f(string a, string b) returns (bool) { return sha256(a) == sha256(b); }
+ function f(string a, string b) returns (bool) { return sha256(bytes(a)) == sha256(bytes(b)); }
}
)";
compileBothVersions(sourceCode);
diff --git a/test/libsolidity/SolidityTypes.cpp b/test/libsolidity/SolidityTypes.cpp
index ba0e9d4f..b8b537e5 100644
--- a/test/libsolidity/SolidityTypes.cpp
+++ b/test/libsolidity/SolidityTypes.cpp
@@ -60,7 +60,21 @@ BOOST_AUTO_TEST_CASE(byte_types)
BOOST_AUTO_TEST_CASE(fixed_types)
{
BOOST_CHECK(*Type::fromElementaryTypeName(ElementaryTypeNameToken(Token::Fixed, 0, 0)) == *make_shared<FixedPointType>(128, 18, FixedPointType::Modifier::Signed));
+ for (unsigned i = 8; i <= 256; i += 8)
+ {
+ BOOST_CHECK(*Type::fromElementaryTypeName(ElementaryTypeNameToken(Token::FixedMxN, i, 0)) == *make_shared<FixedPointType>(i, 0, FixedPointType::Modifier::Signed));
+ BOOST_CHECK(*Type::fromElementaryTypeName(ElementaryTypeNameToken(Token::FixedMxN, i, 2)) == *make_shared<FixedPointType>(i, 2, FixedPointType::Modifier::Signed));
+ }
+}
+
+BOOST_AUTO_TEST_CASE(ufixed_types)
+{
BOOST_CHECK(*Type::fromElementaryTypeName(ElementaryTypeNameToken(Token::UFixed, 0, 0)) == *make_shared<FixedPointType>(128, 18, FixedPointType::Modifier::Unsigned));
+ for (unsigned i = 8; i <= 256; i += 8)
+ {
+ BOOST_CHECK(*Type::fromElementaryTypeName(ElementaryTypeNameToken(Token::UFixedMxN, i, 0)) == *make_shared<FixedPointType>(i, 0, FixedPointType::Modifier::Unsigned));
+ BOOST_CHECK(*Type::fromElementaryTypeName(ElementaryTypeNameToken(Token::UFixedMxN, i, 2)) == *make_shared<FixedPointType>(i, 2, FixedPointType::Modifier::Unsigned));
+ }
}
BOOST_AUTO_TEST_CASE(storage_layout_simple)
@@ -115,12 +129,13 @@ BOOST_AUTO_TEST_CASE(storage_layout_arrays)
BOOST_CHECK(ArrayType(DataLocation::Storage, make_shared<FixedBytesType>(32), 9).storageSize() == 9);
}
-BOOST_AUTO_TEST_CASE(type_escaping)
+BOOST_AUTO_TEST_CASE(type_identifier_escaping)
{
BOOST_CHECK_EQUAL(Type::escapeIdentifier("("), "$_");
BOOST_CHECK_EQUAL(Type::escapeIdentifier(")"), "_$");
BOOST_CHECK_EQUAL(Type::escapeIdentifier(","), "_$_");
BOOST_CHECK_EQUAL(Type::escapeIdentifier("$"), "$$$");
+ BOOST_CHECK_EQUAL(Type::escapeIdentifier(")$("), "_$$$$$_");
BOOST_CHECK_EQUAL(Type::escapeIdentifier("()"), "$__$");
BOOST_CHECK_EQUAL(Type::escapeIdentifier("(,)"), "$__$__$");
BOOST_CHECK_EQUAL(Type::escapeIdentifier("(,$,)"), "$__$_$$$_$__$");
@@ -137,7 +152,7 @@ BOOST_AUTO_TEST_CASE(type_identifiers)
BOOST_CHECK_EQUAL(Type::fromElementaryTypeName("int128")->identifier(), "t_int128");
BOOST_CHECK_EQUAL(Type::fromElementaryTypeName("address")->identifier(), "t_address");
BOOST_CHECK_EQUAL(Type::fromElementaryTypeName("uint8")->identifier(), "t_uint8");
- BOOST_CHECK_EQUAL(Type::fromElementaryTypeName("ufixed8x64")->identifier(), "t_ufixed8x64");
+ BOOST_CHECK_EQUAL(Type::fromElementaryTypeName("ufixed64x2")->identifier(), "t_ufixed64x2");
BOOST_CHECK_EQUAL(Type::fromElementaryTypeName("fixed128x8")->identifier(), "t_fixed128x8");
BOOST_CHECK_EQUAL(RationalNumberType(rational(7, 1)).identifier(), "t_rational_7_by_1");
BOOST_CHECK_EQUAL(RationalNumberType(rational(200, 77)).identifier(), "t_rational_200_by_77");
@@ -146,6 +161,7 @@ BOOST_AUTO_TEST_CASE(type_identifiers)
StringLiteralType(Literal(SourceLocation{}, Token::StringLiteral, make_shared<string>("abc - def"))).identifier(),
"t_stringliteral_196a9142ee0d40e274a6482393c762b16dd8315713207365e1e13d8d85b74fc4"
);
+ BOOST_CHECK_EQUAL(Type::fromElementaryTypeName("byte")->identifier(), "t_bytes1");
BOOST_CHECK_EQUAL(Type::fromElementaryTypeName("bytes8")->identifier(), "t_bytes8");
BOOST_CHECK_EQUAL(Type::fromElementaryTypeName("bytes32")->identifier(), "t_bytes32");
BOOST_CHECK_EQUAL(Type::fromElementaryTypeName("bool")->identifier(), "t_bool");
diff --git a/test/libsolidity/syntaxTests/constants/cyclic_dependency_2.sol b/test/libsolidity/syntaxTests/constants/cyclic_dependency_2.sol
index 08d20c3a..9f1d9722 100644
--- a/test/libsolidity/syntaxTests/constants/cyclic_dependency_2.sol
+++ b/test/libsolidity/syntaxTests/constants/cyclic_dependency_2.sol
@@ -1,12 +1,10 @@
contract C {
uint constant a = b * c;
uint constant b = 7;
- uint constant c = b + uint(keccak256(d));
+ uint constant c = b + uint(keccak256(abi.encodePacked(d)));
uint constant d = 2 + a;
}
// ----
-// Warning: (98-110): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// Warning: (98-110): The provided argument of type uint256 is not implicitly convertible to expected type bytes memory.
// TypeError: (17-40): The value of the constant a has a cyclic dependency via c.
-// TypeError: (71-111): The value of the constant c has a cyclic dependency via d.
-// TypeError: (117-140): The value of the constant d has a cyclic dependency via a.
+// TypeError: (71-129): The value of the constant c has a cyclic dependency via d.
+// TypeError: (135-158): The value of the constant d has a cyclic dependency via a.
diff --git a/test/libsolidity/syntaxTests/constants/cyclic_dependency_4.sol b/test/libsolidity/syntaxTests/constants/cyclic_dependency_4.sol
index df5cd969..cc34fad2 100644
--- a/test/libsolidity/syntaxTests/constants/cyclic_dependency_4.sol
+++ b/test/libsolidity/syntaxTests/constants/cyclic_dependency_4.sol
@@ -1,9 +1,7 @@
contract C {
uint constant a = b * c;
uint constant b = 7;
- uint constant c = 4 + uint(keccak256(d));
+ uint constant c = 4 + uint(keccak256(abi.encode(d)));
uint constant d = 2 + b;
}
// ----
-// Warning: (98-110): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// Warning: (98-110): The provided argument of type uint256 is not implicitly convertible to expected type bytes memory.
diff --git a/test/libsolidity/syntaxTests/deprecated_functions.sol b/test/libsolidity/syntaxTests/deprecated_functions.sol
index ff3af7d2..62dfcff9 100644
--- a/test/libsolidity/syntaxTests/deprecated_functions.sol
+++ b/test/libsolidity/syntaxTests/deprecated_functions.sol
@@ -1,12 +1,12 @@
contract test {
function f() pure public {
- bytes32 x = sha3();
+ bytes32 x = sha3("");
x;
}
function g() public {
- suicide(1);
+ suicide(0x0000000000000000000000000000000000000001);
}
}
// ----
-// TypeError: (58-64): "sha3" has been deprecated in favour of "keccak256"
-// TypeError: (99-109): "suicide" has been deprecated in favour of "selfdestruct"
+// TypeError: (58-66): "sha3" has been deprecated in favour of "keccak256"
+// TypeError: (101-152): "suicide" has been deprecated in favour of "selfdestruct"
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/fallback/default_visibility.sol b/test/libsolidity/syntaxTests/fallback/default_visibility.sol
new file mode 100644
index 00000000..2cb0af90
--- /dev/null
+++ b/test/libsolidity/syntaxTests/fallback/default_visibility.sol
@@ -0,0 +1,6 @@
+contract C {
+ // Check that visibility is also enforced for the fallback function.
+ function() {}
+}
+// ----
+// Warning: (90-103): No visibility specified. Defaulting to "public".
diff --git a/test/libsolidity/syntaxTests/fallback/pure_modifier.sol b/test/libsolidity/syntaxTests/fallback/pure_modifier.sol
index 20d5b0ac..12d790d1 100644
--- a/test/libsolidity/syntaxTests/fallback/pure_modifier.sol
+++ b/test/libsolidity/syntaxTests/fallback/pure_modifier.sol
@@ -1,6 +1,6 @@
contract C {
uint x;
- function() pure { x = 2; }
+ function() external pure { x = 2; }
}
// ----
-// TypeError: (29-55): Fallback function must be payable or non-payable, but is "pure".
+// TypeError: (29-64): Fallback function must be payable or non-payable, but is "pure".
diff --git a/test/libsolidity/syntaxTests/fallback/view_modifier.sol b/test/libsolidity/syntaxTests/fallback/view_modifier.sol
index 44c5d204..2497e9fa 100644
--- a/test/libsolidity/syntaxTests/fallback/view_modifier.sol
+++ b/test/libsolidity/syntaxTests/fallback/view_modifier.sol
@@ -1,6 +1,6 @@
contract C {
uint x;
- function() view { x = 2; }
+ function() external view { x = 2; }
}
// ----
-// TypeError: (29-55): Fallback function must be payable or non-payable, but is "view".
+// TypeError: (29-64): Fallback function must be payable or non-payable, but is "view".
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/globalFunctions/call_with_wrong_arg_count.sol b/test/libsolidity/syntaxTests/globalFunctions/call_with_wrong_arg_count.sol
new file mode 100644
index 00000000..e8134539
--- /dev/null
+++ b/test/libsolidity/syntaxTests/globalFunctions/call_with_wrong_arg_count.sol
@@ -0,0 +1,13 @@
+contract C {
+ function f() public {
+ require(address(this).call());
+ require(address(this).call(bytes4(0x12345678)));
+ require(address(this).call(uint(1)));
+ require(address(this).call(uint(1), uint(2)));
+ }
+}
+// ----
+// TypeError: (55-75): Wrong argument count for function call: 0 arguments given but expected 1. This function requires a single bytes argument. Use "" as argument to provide empty calldata.
+// TypeError: (113-131): Invalid type for argument in function call. Invalid implicit conversion from bytes4 to bytes memory requested. This function requires a single bytes argument. If all your arguments are value types, you can use abi.encode(...) to properly generate it.
+// TypeError: (170-177): Invalid type for argument in function call. Invalid implicit conversion from uint256 to bytes memory requested. This function requires a single bytes argument. If all your arguments are value types, you can use abi.encode(...) to properly generate it.
+// TypeError: (197-233): Wrong argument count for function call: 2 arguments given but expected 1. This function requires a single bytes argument. If all your arguments are value types, you can use abi.encode(...) to properly generate it.
diff --git a/test/libsolidity/syntaxTests/globalFunctions/callcode_with_wrong_arg_count.sol b/test/libsolidity/syntaxTests/globalFunctions/callcode_with_wrong_arg_count.sol
new file mode 100644
index 00000000..2b424d53
--- /dev/null
+++ b/test/libsolidity/syntaxTests/globalFunctions/callcode_with_wrong_arg_count.sol
@@ -0,0 +1,11 @@
+contract C {
+ function f() public {
+ require(address(this).callcode());
+ require(address(this).callcode(uint(1)));
+ require(address(this).callcode(uint(1), uint(2)));
+ }
+}
+// ----
+// TypeError: (55-79): Wrong argument count for function call: 0 arguments given but expected 1. This function requires a single bytes argument. Use "" as argument to provide empty calldata.
+// TypeError: (121-128): Invalid type for argument in function call. Invalid implicit conversion from uint256 to bytes memory requested. This function requires a single bytes argument. If all your arguments are value types, you can use abi.encode(...) to properly generate it.
+// TypeError: (148-188): Wrong argument count for function call: 2 arguments given but expected 1. This function requires a single bytes argument. If all your arguments are value types, you can use abi.encode(...) to properly generate it.
diff --git a/test/libsolidity/syntaxTests/globalFunctions/delegatecall_with_wrong_arg_count.sol b/test/libsolidity/syntaxTests/globalFunctions/delegatecall_with_wrong_arg_count.sol
new file mode 100644
index 00000000..be0347de
--- /dev/null
+++ b/test/libsolidity/syntaxTests/globalFunctions/delegatecall_with_wrong_arg_count.sol
@@ -0,0 +1,11 @@
+contract C {
+ function f() public {
+ require(address(this).delegatecall());
+ require(address(this).delegatecall(uint(1)));
+ require(address(this).delegatecall(uint(1), uint(2)));
+ }
+}
+// ----
+// TypeError: (55-83): Wrong argument count for function call: 0 arguments given but expected 1. This function requires a single bytes argument. Use "" as argument to provide empty calldata.
+// TypeError: (129-136): Invalid type for argument in function call. Invalid implicit conversion from uint256 to bytes memory requested. This function requires a single bytes argument. If all your arguments are value types, you can use abi.encode(...) to properly generate it.
+// TypeError: (156-200): Wrong argument count for function call: 2 arguments given but expected 1. This function requires a single bytes argument. If all your arguments are value types, you can use abi.encode(...) to properly generate it.
diff --git a/test/libsolidity/syntaxTests/globalFunctions/keccak256_with_wrong_arg_count.sol b/test/libsolidity/syntaxTests/globalFunctions/keccak256_with_wrong_arg_count.sol
new file mode 100644
index 00000000..4857bc2e
--- /dev/null
+++ b/test/libsolidity/syntaxTests/globalFunctions/keccak256_with_wrong_arg_count.sol
@@ -0,0 +1,11 @@
+contract C {
+ function f() public {
+ require(keccak256() != 0);
+ require(keccak256(uint(1)) != 0);
+ require(keccak256(uint(1), uint(2)) != 0);
+ }
+}
+// ----
+// TypeError: (55-66): Wrong argument count for function call: 0 arguments given but expected 1. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
+// TypeError: (100-107): Invalid type for argument in function call. Invalid implicit conversion from uint256 to bytes memory requested. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
+// TypeError: (132-159): Wrong argument count for function call: 2 arguments given but expected 1. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
diff --git a/test/libsolidity/syntaxTests/globalFunctions/ripemd160_with_wrong_arg_count.sol b/test/libsolidity/syntaxTests/globalFunctions/ripemd160_with_wrong_arg_count.sol
new file mode 100644
index 00000000..da41fccd
--- /dev/null
+++ b/test/libsolidity/syntaxTests/globalFunctions/ripemd160_with_wrong_arg_count.sol
@@ -0,0 +1,11 @@
+contract C {
+ function f() public {
+ require(ripemd160() != 0);
+ require(ripemd160(uint(1)) != 0);
+ require(ripemd160(uint(1), uint(2)) != 0);
+ }
+}
+// ----
+// TypeError: (55-66): Wrong argument count for function call: 0 arguments given but expected 1. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
+// TypeError: (100-107): Invalid type for argument in function call. Invalid implicit conversion from uint256 to bytes memory requested. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
+// TypeError: (132-159): Wrong argument count for function call: 2 arguments given but expected 1. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
diff --git a/test/libsolidity/syntaxTests/globalFunctions/sha256_with_wrong_arg_count.sol b/test/libsolidity/syntaxTests/globalFunctions/sha256_with_wrong_arg_count.sol
new file mode 100644
index 00000000..2939e7fc
--- /dev/null
+++ b/test/libsolidity/syntaxTests/globalFunctions/sha256_with_wrong_arg_count.sol
@@ -0,0 +1,11 @@
+contract C {
+ function f() public {
+ require(sha256() != 0);
+ require(sha256(uint(1)) != 0);
+ require(sha256(uint(1), uint(2)) != 0);
+ }
+}
+// ----
+// TypeError: (55-63): Wrong argument count for function call: 0 arguments given but expected 1. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
+// TypeError: (94-101): Invalid type for argument in function call. Invalid implicit conversion from uint256 to bytes memory requested. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
+// TypeError: (126-150): Wrong argument count for function call: 2 arguments given but expected 1. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
diff --git a/test/libsolidity/syntaxTests/multiVariableDeclaration/multiVariableDeclarationInvalid.sol b/test/libsolidity/syntaxTests/multiVariableDeclaration/multiVariableDeclarationInvalid.sol
deleted file mode 100644
index c8686ae8..00000000
--- a/test/libsolidity/syntaxTests/multiVariableDeclaration/multiVariableDeclarationInvalid.sol
+++ /dev/null
@@ -1,8 +0,0 @@
-contract C {
- function f() internal returns (uint, uint, uint, uint) {
- var (uint a, uint b,,) = f();
- a; b;
- }
-}
-// ----
-// ParserError: (81-85): Expected identifier but got 'uint'
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/074_fallback_function.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/074_fallback_function.sol
index 7e64bbe2..466e80cb 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/074_fallback_function.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/074_fallback_function.sol
@@ -1,4 +1,4 @@
contract C {
uint x;
- function() public { x = 2; }
+ function() external { x = 2; }
}
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/075_fallback_function_with_arguments.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/075_fallback_function_with_arguments.sol
index 2c1d2a1b..68d40952 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/075_fallback_function_with_arguments.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/075_fallback_function_with_arguments.sol
@@ -1,6 +1,6 @@
contract C {
uint x;
- function(uint a) public { x = 2; }
+ function(uint a) external { x = 2; }
}
// ----
// TypeError: (37-45): Fallback function cannot take parameters.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/076_fallback_function_in_library.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/076_fallback_function_in_library.sol
index 11fef976..25878a61 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/076_fallback_function_in_library.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/076_fallback_function_in_library.sol
@@ -1,5 +1,5 @@
library C {
- function() public {}
+ function() external {}
}
// ----
-// TypeError: (16-36): Libraries cannot have fallback functions.
+// TypeError: (16-38): Libraries cannot have fallback functions.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/077_fallback_function_with_return_parameters.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/077_fallback_function_with_return_parameters.sol
index 905bcd2d..3ff7a1c4 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/077_fallback_function_with_return_parameters.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/077_fallback_function_with_return_parameters.sol
@@ -1,5 +1,5 @@
contract C {
- function() public returns (uint) { }
+ function() external returns (uint) { }
}
// ----
-// TypeError: (43-49): Fallback function cannot return values.
+// TypeError: (45-51): Fallback function cannot return values.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/078_fallback_function_twice.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/078_fallback_function_twice.sol
index 8d839da0..e5746c63 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/078_fallback_function_twice.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/078_fallback_function_twice.sol
@@ -1,7 +1,7 @@
contract C {
uint x;
- function() public { x = 2; }
- function() public { x = 3; }
+ function() external { x = 2; }
+ function() external { x = 3; }
}
// ----
-// DeclarationError: (62-90): Only one fallback function is allowed.
+// DeclarationError: (64-94): Only one fallback function is allowed.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/079_fallback_function_inheritance.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/079_fallback_function_inheritance.sol
index a35a8093..c8c06c6e 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/079_fallback_function_inheritance.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/079_fallback_function_inheritance.sol
@@ -1,7 +1,7 @@
contract A {
uint x;
- function() public { x = 1; }
+ function() external { x = 1; }
}
contract C is A {
- function() public { x = 2; }
+ function() external { x = 2; }
}
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/080_event.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/080_event.sol
index 780d26a6..c5f9e4d0 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/080_event.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/080_event.sol
@@ -1,6 +1,5 @@
contract c {
event e(uint indexed a, bytes3 indexed s, bool indexed b);
- function f() public { e(2, "abc", true); }
+ function f() public { emit e(2, "abc", true); }
}
// ----
-// Warning: (102-119): Invoking events without "emit" prefix is deprecated.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/090_event_call.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/090_event_call.sol
index abf46f94..8cf50597 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/090_event_call.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/090_event_call.sol
@@ -1,6 +1,5 @@
contract c {
event e(uint a, bytes3 indexed s, bool indexed b);
- function f() public { e(2, "abc", true); }
+ function f() public { emit e(2, "abc", true); }
}
// ----
-// Warning: (94-111): Invoking events without "emit" prefix is deprecated.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/094_event_inheritance.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/094_event_inheritance.sol
index d177209b..b13d5755 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/094_event_inheritance.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/094_event_inheritance.sol
@@ -2,7 +2,6 @@ contract base {
event e(uint a, bytes3 indexed s, bool indexed b);
}
contract c is base {
- function f() public { e(2, "abc", true); }
+ function f() public { emit e(2, "abc", true); }
}
// ----
-// Warning: (120-137): Invoking events without "emit" prefix is deprecated.
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/196_integer_boolean_or.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/196_integer_boolean_or.sol
index 1b522c00..db42786d 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/196_integer_boolean_or.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/196_integer_boolean_or.sol
@@ -1,3 +1,3 @@
-contract test { function() public { uint x = 1; uint y = 2; x || y; } }
+contract test { function() external { uint x = 1; uint y = 2; x || y; } }
// ----
-// TypeError: (60-66): Operator || not compatible with types uint256 and uint256
+// TypeError: (62-68): Operator || not compatible with types uint256 and uint256
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/197_integer_boolean_and.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/197_integer_boolean_and.sol
index cbc3732f..94d1c691 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/197_integer_boolean_and.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/197_integer_boolean_and.sol
@@ -1,3 +1,3 @@
-contract test { function() public { uint x = 1; uint y = 2; x && y; } }
+contract test { function() external { uint x = 1; uint y = 2; x && y; } }
// ----
-// TypeError: (60-66): Operator && not compatible with types uint256 and uint256
+// TypeError: (62-68): Operator && not compatible with types uint256 and uint256
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/198_integer_boolean_not.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/198_integer_boolean_not.sol
index 1d36b0b3..68fe6e94 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/198_integer_boolean_not.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/198_integer_boolean_not.sol
@@ -1,3 +1,3 @@
-contract test { function() public { uint x = 1; !x; } }
+contract test { function() external { uint x = 1; !x; } }
// ----
-// TypeError: (48-50): Unary operator ! cannot be applied to type uint256
+// TypeError: (50-52): Unary operator ! cannot be applied to type uint256
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/199_integer_unsigned_exp_signed.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/199_integer_unsigned_exp_signed.sol
index 5b8b2d3f..fbeadfb6 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/199_integer_unsigned_exp_signed.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/199_integer_unsigned_exp_signed.sol
@@ -1,3 +1,3 @@
-contract test { function() public { uint x = 3; int y = -4; x ** y; } }
+contract test { function() external { uint x = 3; int y = -4; x ** y; } }
// ----
-// TypeError: (60-66): Operator ** not compatible with types uint256 and int256
+// TypeError: (62-68): Operator ** not compatible with types uint256 and int256
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/200_integer_signed_exp_unsigned.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/200_integer_signed_exp_unsigned.sol
index 95c19d17..75e92085 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/200_integer_signed_exp_unsigned.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/200_integer_signed_exp_unsigned.sol
@@ -1,3 +1,3 @@
-contract test { function() public { uint x = 3; int y = -4; y ** x; } }
+contract test { function() external { uint x = 3; int y = -4; y ** x; } }
// ----
-// TypeError: (60-66): Operator ** not compatible with types int256 and uint256
+// TypeError: (62-68): Operator ** not compatible with types int256 and uint256
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/201_integer_signed_exp_signed.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/201_integer_signed_exp_signed.sol
index 394dec88..93e5f065 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/201_integer_signed_exp_signed.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/201_integer_signed_exp_signed.sol
@@ -1,3 +1,3 @@
-contract test { function() public { int x = -3; int y = -4; x ** y; } }
+contract test { function() external { int x = -3; int y = -4; x ** y; } }
// ----
-// TypeError: (60-66): Operator ** not compatible with types int256 and int256
+// TypeError: (62-68): Operator ** not compatible with types int256 and int256
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/202_bytes_reference_compare_operators.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/202_bytes_reference_compare_operators.sol
index d4c513dd..711b794c 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/202_bytes_reference_compare_operators.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/202_bytes_reference_compare_operators.sol
@@ -1,3 +1,3 @@
-contract test { bytes a; bytes b; function() public { a == b; } }
+contract test { bytes a; bytes b; function() external { a == b; } }
// ----
-// TypeError: (54-60): Operator == not compatible with types bytes storage ref and bytes storage ref
+// TypeError: (56-62): Operator == not compatible with types bytes storage ref and bytes storage ref
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol
index de96b798..a74850b3 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol
@@ -1,3 +1,10 @@
-contract test { struct s {uint a;} s x; s y; function() public { x == y; } }
+contract test {
+ struct s {uint a;}
+ s x;
+ s y;
+ function() external {
+ x == y;
+ }
+}
// ----
-// TypeError: (65-71): Operator == not compatible with types struct test.s storage ref and struct test.s storage ref
+// TypeError: (79-85): Operator == not compatible with types struct test.s storage ref and struct test.s 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/235_abi_encode_with_large_integer_constant.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/235_abi_encode_with_large_integer_constant.sol
new file mode 100644
index 00000000..fd9717f1
--- /dev/null
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/235_abi_encode_with_large_integer_constant.sol
@@ -0,0 +1,5 @@
+contract C {
+ function f() pure public { abi.encode(2**500); }
+}
+// ----
+// TypeError: (55-61): Invalid rational number (too large or division by zero).
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/235_keccak256_with_large_integer_constant.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/235_keccak256_with_large_integer_constant.sol
deleted file mode 100644
index c39d0fe2..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/235_keccak256_with_large_integer_constant.sol
+++ /dev/null
@@ -1,7 +0,0 @@
-contract C {
- function f() public { keccak256(2**500); }
-}
-// ----
-// Warning: (39-56): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// Warning: (39-56): The provided argument of type int_const 3273...(143 digits omitted)...9376 is not implicitly convertible to expected type bytes memory.
-// TypeError: (49-55): Invalid rational number (too large or division by zero).
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/248_tuple_assignment_from_void_function.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/248_tuple_assignment_from_void_function.sol
deleted file mode 100644
index f3e02ecb..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/248_tuple_assignment_from_void_function.sol
+++ /dev/null
@@ -1,11 +0,0 @@
-contract C {
- function f() public { }
- function g() public {
- var (x,) = (f(), f());
- }
-}
-// ----
-// Warning: (80-81): Use of the "var" keyword is deprecated.
-// Warning: (87-90): Tuple component cannot be empty.
-// Warning: (92-95): Tuple component cannot be empty.
-// TypeError: (80-81): Cannot declare variable with void (empty tuple) type.
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/406_invalid_address_checksum.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/406_invalid_address_checksum.sol
index 8084e0d1..fe4691c2 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/406_invalid_address_checksum.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/406_invalid_address_checksum.sol
@@ -5,4 +5,4 @@ contract C {
}
}
// ----
-// Warning: (64-106): This looks like an address but has an invalid checksum. If this is not used as an address, please prepend '00'. Correct checksummed address: '0xfA0bFc97E48458494Ccd857e1A85DC91F7F0046E'. For more information please see https://solidity.readthedocs.io/en/develop/types.html#address-literals
+// SyntaxError: (64-106): This looks like an address but has an invalid checksum. Correct checksummed address: "0xfA0bFc97E48458494Ccd857e1A85DC91F7F0046E". If this is not used as an address, please prepend '00'. For more information please see https://solidity.readthedocs.io/en/develop/types.html#address-literals
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/407_invalid_address_no_checksum.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/407_invalid_address_no_checksum.sol
index 51521fe6..6f4ac730 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/407_invalid_address_no_checksum.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/407_invalid_address_no_checksum.sol
@@ -5,4 +5,4 @@ contract C {
}
}
// ----
-// Warning: (64-106): This looks like an address but has an invalid checksum. If this is not used as an address, please prepend '00'. Correct checksummed address: '0xfA0bFc97E48458494Ccd857e1A85DC91F7F0046E'. For more information please see https://solidity.readthedocs.io/en/develop/types.html#address-literals
+// SyntaxError: (64-106): This looks like an address but has an invalid checksum. Correct checksummed address: "0xfA0bFc97E48458494Ccd857e1A85DC91F7F0046E". If this is not used as an address, please prepend '00'. For more information please see https://solidity.readthedocs.io/en/develop/types.html#address-literals
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/408_invalid_address_length_short.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/408_invalid_address_length_short.sol
index 4dd93c63..da5dc380 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/408_invalid_address_length_short.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/408_invalid_address_length_short.sol
@@ -5,4 +5,4 @@ contract C {
}
}
// ----
-// Warning: (64-105): This looks like an address but has an invalid checksum. If this is not used as an address, please prepend '00'. Correct checksummed address: '0x0A0BfC97E48458494ccD857e1A85Dc91f7f0046e'. For more information please see https://solidity.readthedocs.io/en/develop/types.html#address-literals
+// SyntaxError: (64-105): This looks like an address but is not exactly 40 hex digits. It is 39 hex digits. If this is not used as an address, please prepend '00'. For more information please see https://solidity.readthedocs.io/en/develop/types.html#address-literals
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/409_invalid_address_length_long.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/409_invalid_address_length_long.sol
index 37c6aa05..749612c9 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/409_invalid_address_length_long.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/409_invalid_address_length_long.sol
@@ -5,5 +5,4 @@ contract C {
}
}
// ----
-// Warning: (64-107): This looks like an address but has an invalid checksum. If this is not used as an address, please prepend '00'. For more information please see https://solidity.readthedocs.io/en/develop/types.html#address-literals
-// TypeError: (52-107): Type int_const 2284...(42 digits omitted)...9360 is not implicitly convertible to expected type address.
+// SyntaxError: (64-107): This looks like an address but is not exactly 40 hex digits. It is 41 hex digits. If this is not used as an address, please prepend '00'. For more information please see https://solidity.readthedocs.io/en/develop/types.html#address-literals
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/413_address_methods.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/413_address_methods.sol
index d0c3769c..9c42bc8f 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/413_address_methods.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/413_address_methods.sol
@@ -2,8 +2,8 @@ contract C {
function f() public {
address addr;
uint balance = addr.balance;
- bool callRet = addr.call();
- bool delegatecallRet = addr.delegatecall();
+ bool callRet = addr.call("");
+ bool delegatecallRet = addr.delegatecall("");
bool sendRet = addr.send(1);
addr.transfer(1);
balance; callRet; delegatecallRet; sendRet;
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/415_interface_functions.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/415_interface_functions.sol
index 1f227b54..a5d6561e 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/415_interface_functions.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/415_interface_functions.sol
@@ -1,9 +1,5 @@
interface I {
- function();
- function f();
+ function() external;
+ function f() external;
}
// ----
-// Warning: (18-29): Functions in interfaces should be declared external.
-// Warning: (34-47): Functions in interfaces should be declared external.
-// Warning: (18-29): No visibility specified. Defaulting to "public". In interfaces it defaults to external.
-// Warning: (34-47): No visibility specified. Defaulting to "public". In interfaces it defaults to external.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/424_using_interface_complex.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/424_using_interface_complex.sol
index a73c29bf..a3dca996 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/424_using_interface_complex.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/424_using_interface_complex.sol
@@ -1,17 +1,11 @@
interface I {
event A();
- function f();
- function g();
- function();
+ function f() external;
+ function g() external;
+ function() external;
}
contract C is I {
function f() public {
}
}
// ----
-// Warning: (33-46): Functions in interfaces should be declared external.
-// Warning: (51-64): Functions in interfaces should be declared external.
-// Warning: (69-80): Functions in interfaces should be declared external.
-// Warning: (33-46): No visibility specified. Defaulting to "public". In interfaces it defaults to external.
-// Warning: (51-64): No visibility specified. Defaulting to "public". In interfaces it defaults to external.
-// Warning: (69-80): No visibility specified. Defaulting to "public". In interfaces it defaults to external.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/463_error_transfer_non_payable_fallback.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/463_error_transfer_non_payable_fallback.sol
index 3f6b0283..2b2ef39e 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/463_error_transfer_non_payable_fallback.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/463_error_transfer_non_payable_fallback.sol
@@ -2,16 +2,16 @@
// because A's fallback function is not payable.
contract A {
- function() public {}
+ function() external {}
}
contract B {
A a;
- function() public {
+ function() external {
a.transfer(100);
}
}
// ----
-// Warning: (209-219): Using contract member "transfer" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).transfer" instead.
-// TypeError: (209-219): Value transfer to a contract without a payable fallback function.
+// Warning: (213-223): Using contract member "transfer" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).transfer" instead.
+// TypeError: (213-223): Value transfer to a contract without a payable fallback function.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/464_error_transfer_no_fallback.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/464_error_transfer_no_fallback.sol
index afa86040..67398de7 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/464_error_transfer_no_fallback.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/464_error_transfer_no_fallback.sol
@@ -6,10 +6,10 @@ contract A {}
contract B {
A a;
- function() public {
+ function() external {
a.transfer(100);
}
}
// ----
-// Warning: (190-200): Using contract member "transfer" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).transfer" instead.
-// TypeError: (190-200): Value transfer to a contract without a payable fallback function.
+// Warning: (192-202): Using contract member "transfer" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).transfer" instead.
+// TypeError: (192-202): Value transfer to a contract without a payable fallback function.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/465_error_send_non_payable_fallback.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/465_error_send_non_payable_fallback.sol
index 36f7470b..1a4b2e81 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/465_error_send_non_payable_fallback.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/465_error_send_non_payable_fallback.sol
@@ -2,16 +2,16 @@
// because A does not have a payable fallback function.
contract A {
- function() public {}
+ function() external {}
}
contract B {
A a;
- function() public {
+ function() external {
require(a.send(100));
}
}
// ----
-// Warning: (220-226): Using contract member "send" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).send" instead.
-// TypeError: (220-226): Value transfer to a contract without a payable fallback function.
+// Warning: (224-230): Using contract member "send" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).send" instead.
+// TypeError: (224-230): Value transfer to a contract without a payable fallback function.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/466_does_not_error_transfer_payable_fallback.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/466_does_not_error_transfer_payable_fallback.sol
index 1fa567eb..2b7f8dae 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/466_does_not_error_transfer_payable_fallback.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/466_does_not_error_transfer_payable_fallback.sol
@@ -2,15 +2,15 @@
// because A does not have a payable fallback function.
contract A {
- function() payable public {}
+ function() payable external {}
}
contract B {
A a;
- function() public {
+ function() external {
a.transfer(100);
}
}
// ----
-// Warning: (224-234): Using contract member "transfer" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).transfer" instead.
+// Warning: (228-238): Using contract member "transfer" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).transfer" instead.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/467_does_not_error_transfer_regular_function.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/467_does_not_error_transfer_regular_function.sol
index bf027e22..65b4a236 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/467_does_not_error_transfer_regular_function.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/467_does_not_error_transfer_regular_function.sol
@@ -5,7 +5,7 @@ contract A {
contract B {
A a;
- function() public {
+ function() external {
a.transfer();
}
}
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/493_builtin_keccak256_reject_gas.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/493_builtin_keccak256_reject_gas.sol
index bc8c7867..b99431f9 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/493_builtin_keccak256_reject_gas.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/493_builtin_keccak256_reject_gas.sol
@@ -4,4 +4,4 @@ contract C {
}
}
// ----
-// TypeError: (47-60): Member "gas" not found or not visible after argument-dependent lookup in function () pure returns (bytes32)
+// TypeError: (47-60): Member "gas" not found or not visible after argument-dependent lookup in function (bytes memory) pure returns (bytes32)
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/494_builtin_sha256_reject_gas.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/494_builtin_sha256_reject_gas.sol
index f29cd7dd..23c90acb 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/494_builtin_sha256_reject_gas.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/494_builtin_sha256_reject_gas.sol
@@ -4,4 +4,4 @@ contract C {
}
}
// ----
-// TypeError: (47-57): Member "gas" not found or not visible after argument-dependent lookup in function () pure returns (bytes32)
+// TypeError: (47-57): Member "gas" not found or not visible after argument-dependent lookup in function (bytes memory) pure returns (bytes32)
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/495_builtin_ripemd160_reject_gas.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/495_builtin_ripemd160_reject_gas.sol
index b20255fb..5884e212 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/495_builtin_ripemd160_reject_gas.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/495_builtin_ripemd160_reject_gas.sol
@@ -4,4 +4,4 @@ contract C {
}
}
// ----
-// TypeError: (47-60): Member "gas" not found or not visible after argument-dependent lookup in function () pure returns (bytes20)
+// TypeError: (47-60): Member "gas" not found or not visible after argument-dependent lookup in function (bytes memory) pure returns (bytes20)
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/502_builtin_keccak256_reject_value.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/502_builtin_keccak256_reject_value.sol
index a58891d2..61e51eff 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/502_builtin_keccak256_reject_value.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/502_builtin_keccak256_reject_value.sol
@@ -4,4 +4,4 @@ contract C {
}
}
// ----
-// TypeError: (47-62): Member "value" not found or not visible after argument-dependent lookup in function () pure returns (bytes32) - did you forget the "payable" modifier?
+// TypeError: (47-62): Member "value" not found or not visible after argument-dependent lookup in function (bytes memory) pure returns (bytes32) - did you forget the "payable" modifier?
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/503_builtin_sha256_reject_value.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/503_builtin_sha256_reject_value.sol
index 19d671ff..11141a9b 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/503_builtin_sha256_reject_value.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/503_builtin_sha256_reject_value.sol
@@ -4,4 +4,4 @@ contract C {
}
}
// ----
-// TypeError: (47-59): Member "value" not found or not visible after argument-dependent lookup in function () pure returns (bytes32) - did you forget the "payable" modifier?
+// TypeError: (47-59): Member "value" not found or not visible after argument-dependent lookup in function (bytes memory) pure returns (bytes32) - did you forget the "payable" modifier?
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/504_builtin_ripemd160_reject_value.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/504_builtin_ripemd160_reject_value.sol
index 38bb2cb6..d120f3dd 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/504_builtin_ripemd160_reject_value.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/504_builtin_ripemd160_reject_value.sol
@@ -4,4 +4,4 @@ contract C {
}
}
// ----
-// TypeError: (47-62): Member "value" not found or not visible after argument-dependent lookup in function () pure returns (bytes20) - did you forget the "payable" modifier?
+// TypeError: (47-62): Member "value" not found or not visible after argument-dependent lookup in function (bytes memory) pure returns (bytes20) - did you forget the "payable" modifier?
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/526_fallback_marked_external.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/526_fallback_marked_external.sol
new file mode 100644
index 00000000..6ac551e1
--- /dev/null
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/526_fallback_marked_external.sol
@@ -0,0 +1,3 @@
+contract C {
+ function () external { }
+}
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/527_fallback_marked_internal.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/527_fallback_marked_internal.sol
new file mode 100644
index 00000000..2d425037
--- /dev/null
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/527_fallback_marked_internal.sol
@@ -0,0 +1,4 @@
+contract C {
+ function () internal { }
+}
+// ----
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private.sol
new file mode 100644
index 00000000..2105c815
--- /dev/null
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private.sol
@@ -0,0 +1,4 @@
+contract C {
+ function () private { }
+}
+// ----
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public.sol
new file mode 100644
index 00000000..42585137
--- /dev/null
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public.sol
@@ -0,0 +1,4 @@
+contract C {
+ function () public { }
+}
+// ----
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/nameAndTypeResolution/563_event_without_emit_deprecated.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/563_event_without_emit_deprecated.sol
index d6068ff6..e9a56671 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/563_event_without_emit_deprecated.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/563_event_without_emit_deprecated.sol
@@ -5,4 +5,4 @@ contract C {
}
}
// ----
-// Warning: (62-65): Invoking events without "emit" prefix is deprecated.
+// TypeError: (62-65): Event invocations have to be prefixed by "emit".
diff --git a/test/libsolidity/syntaxTests/parsing/else_if_statement.sol b/test/libsolidity/syntaxTests/parsing/else_if_statement.sol
index 727e6115..37763697 100644
--- a/test/libsolidity/syntaxTests/parsing/else_if_statement.sol
+++ b/test/libsolidity/syntaxTests/parsing/else_if_statement.sol
@@ -1,8 +1,8 @@
contract test {
- function fun(uint256 a) returns (address b) {
+ function fun(uint256 a) returns (uint8 b) {
if (a < 0) b = 0x67; else if (a == 0) b = 0x12; else b = 0x78;
}
}
// ----
-// Warning: (20-142): No visibility specified. Defaulting to "public".
-// Warning: (20-142): Function state mutability can be restricted to pure
+// Warning: (20-140): No visibility specified. Defaulting to "public".
+// Warning: (20-140): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/parsing/fallback_function.sol b/test/libsolidity/syntaxTests/parsing/fallback_function.sol
index de32b030..054f57de 100644
--- a/test/libsolidity/syntaxTests/parsing/fallback_function.sol
+++ b/test/libsolidity/syntaxTests/parsing/fallback_function.sol
@@ -1,5 +1,4 @@
contract c {
- function() { }
+ function() external { }
}
// ----
-// Warning: (17-31): No visibility specified. Defaulting to "public".
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/modifier.sol b/test/libsolidity/syntaxTests/parsing/modifier.sol
index 3e659dcf..b995ce89 100644
--- a/test/libsolidity/syntaxTests/parsing/modifier.sol
+++ b/test/libsolidity/syntaxTests/parsing/modifier.sol
@@ -1,3 +1,3 @@
contract c {
- modifier mod { if (msg.sender == 0) _; }
+ modifier mod { if (msg.sender == 0x0000000000000000000000000000000000000000) _; }
}
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/specialFunctions/single_non_bytes_arg.sol b/test/libsolidity/syntaxTests/specialFunctions/single_non_bytes_arg.sol
index a6ee4bf1..c17d0849 100644
--- a/test/libsolidity/syntaxTests/specialFunctions/single_non_bytes_arg.sol
+++ b/test/libsolidity/syntaxTests/specialFunctions/single_non_bytes_arg.sol
@@ -7,9 +7,6 @@ contract C {
function g(bytes32) pure internal {}
}
// ----
-// Warning: (54-72): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// Warning: (54-72): The provided argument of type uint256 is not implicitly convertible to expected type bytes memory.
-// Warning: (85-100): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// Warning: (85-100): The provided argument of type uint256 is not implicitly convertible to expected type bytes memory.
-// Warning: (113-131): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// Warning: (113-131): The provided argument of type uint256 is not implicitly convertible to expected type bytes memory.
+// TypeError: (64-71): Invalid type for argument in function call. Invalid implicit conversion from uint256 to bytes memory requested. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
+// TypeError: (92-99): Invalid type for argument in function call. Invalid implicit conversion from uint256 to bytes memory requested. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
+// TypeError: (123-130): Invalid type for argument in function call. Invalid implicit conversion from uint256 to bytes memory requested. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol
index f1b5606e..c97f588e 100644
--- a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol
+++ b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol
@@ -1,13 +1,13 @@
contract C {
function f() public pure {
- bool a = address(this).call(address(this).delegatecall, super);
- bool b = address(this).delegatecall(log0, tx, mulmod);
+ bool a = address(this).call(abi.encode(address(this).delegatecall, super));
+ bool b = address(this).delegatecall(abi.encode(log0, tx, mulmod));
a; b;
}
}
// ----
-// TypeError: (80-106): This type cannot be encoded.
-// TypeError: (108-113): This type cannot be encoded.
-// TypeError: (160-164): This type cannot be encoded.
-// TypeError: (166-168): This type cannot be encoded.
-// TypeError: (170-176): This type cannot be encoded.
+// TypeError: (91-117): This type cannot be encoded.
+// TypeError: (119-124): This type cannot be encoded.
+// TypeError: (183-187): This type cannot be encoded.
+// TypeError: (189-191): This type cannot be encoded.
+// TypeError: (193-199): This type cannot be encoded.
diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol
index 05f5db0b..a1d3f5af 100644
--- a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol
+++ b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol
@@ -4,11 +4,10 @@ contract C {
struct T { uint y; }
T t;
function f() public view {
- bytes32 a = sha256(s, t);
+ bytes32 a = sha256(abi.encodePacked(s, t));
a;
}
}
// ----
-// Warning: (132-144): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// TypeError: (139-140): This type cannot be encoded.
-// TypeError: (142-143): This type cannot be encoded.
+// TypeError: (156-157): This type cannot be encoded.
+// TypeError: (159-160): This type cannot be encoded.
diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs_abiv2.sol b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs_abiv2.sol
index 977a7d73..38702825 100644
--- a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs_abiv2.sol
+++ b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs_abiv2.sol
@@ -6,12 +6,11 @@ contract C {
struct T { uint y; }
T t;
function f() public view {
- bytes32 a = sha256(s, t);
+ bytes32 a = sha256(abi.encodePacked(s, t));
a;
}
}
// ----
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
-// Warning: (167-179): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// TypeError: (174-175): This type cannot be encoded.
-// TypeError: (177-178): This type cannot be encoded.
+// TypeError: (191-192): This type cannot be encoded.
+// TypeError: (194-195): This type cannot be encoded.
diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_types.sol b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_types.sol
index e46a9050..b50d4449 100644
--- a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_types.sol
+++ b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_types.sol
@@ -5,12 +5,13 @@ contract C {
T t;
enum A { X, Y }
function f() public pure {
- bool a = address(this).delegatecall(S, A, A.X, T, uint, uint[]);
+ bytes memory a = abi.encodePacked(S, A, A.X, T, uint, uint[]);
+ a;
}
}
// ----
-// TypeError: (176-177): This type cannot be encoded.
-// TypeError: (179-180): This type cannot be encoded.
-// TypeError: (187-188): This type cannot be encoded.
-// TypeError: (190-194): This type cannot be encoded.
-// TypeError: (196-202): This type cannot be encoded.
+// TypeError: (174-175): This type cannot be encoded.
+// TypeError: (177-178): This type cannot be encoded.
+// TypeError: (185-186): This type cannot be encoded.
+// TypeError: (188-192): This type cannot be encoded.
+// TypeError: (194-200): This type cannot be encoded.
diff --git a/test/libsolidity/syntaxTests/tight_packing_literals.sol b/test/libsolidity/syntaxTests/tight_packing_literals.sol
index d6c7f0ba..be8482ff 100644
--- a/test/libsolidity/syntaxTests/tight_packing_literals.sol
+++ b/test/libsolidity/syntaxTests/tight_packing_literals.sol
@@ -1,26 +1,8 @@
contract C {
- function f() pure public returns (bytes32) {
- return keccak256(1);
- }
- function h() pure public returns (bytes32) {
- return sha256(1);
- }
- function j() pure public returns (bytes32) {
- return ripemd160(1);
- }
function k() pure public returns (bytes) {
return abi.encodePacked(1);
}
}
// ----
-// Warning: (87-88): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
-// Warning: (77-89): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// Warning: (77-89): The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
-// Warning: (168-169): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
-// Warning: (161-170): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// Warning: (161-170): The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
-// Warning: (252-253): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
-// Warning: (242-254): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// Warning: (242-254): The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
-// Warning: (341-342): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
+// Warning: (92-93): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
diff --git a/test/libsolidity/syntaxTests/tight_packing_literals_050.sol b/test/libsolidity/syntaxTests/tight_packing_literals_050.sol
index b7557d2a..4e6210c6 100644
--- a/test/libsolidity/syntaxTests/tight_packing_literals_050.sol
+++ b/test/libsolidity/syntaxTests/tight_packing_literals_050.sol
@@ -1,34 +1,9 @@
pragma experimental "v0.5.0";
contract C {
- function f() pure public returns (bytes32) {
- return keccak256(1);
- }
- function g() pure public returns (bytes32) {
- return sha3(1);
- }
- function h() pure public returns (bytes32) {
- return sha256(1);
- }
- function j() pure public returns (bytes32) {
- return ripemd160(1);
- }
function k() pure public returns (bytes) {
return abi.encodePacked(1);
}
}
// ----
-// TypeError: (117-118): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.
-// TypeError: (107-119): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// TypeError: (107-119): The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
-// TypeError: (191-198): "sha3" has been deprecated in favour of "keccak256"
-// TypeError: (196-197): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.
-// TypeError: (191-198): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// TypeError: (191-198): The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
-// TypeError: (277-278): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.
-// TypeError: (270-279): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// TypeError: (270-279): The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
-// TypeError: (361-362): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.
-// TypeError: (351-363): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// TypeError: (351-363): The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
-// TypeError: (450-451): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.
+// TypeError: (122-123): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.
diff --git a/test/libsolidity/syntaxTests/tight_packing_literals_fine.sol b/test/libsolidity/syntaxTests/tight_packing_literals_fine.sol
index 27665b52..7bbc36d0 100644
--- a/test/libsolidity/syntaxTests/tight_packing_literals_fine.sol
+++ b/test/libsolidity/syntaxTests/tight_packing_literals_fine.sol
@@ -1,13 +1,4 @@
contract C {
- function f() pure public returns (bytes32) {
- return keccak256(uint8(1));
- }
- function h() pure public returns (bytes32) {
- return sha256(uint8(1));
- }
- function j() pure public returns (bytes32) {
- return ripemd160(uint8(1));
- }
function k() pure public returns (bytes) {
return abi.encodePacked(uint8(1));
}
@@ -16,9 +7,3 @@ contract C {
}
}
// ----
-// Warning: (77-96): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// Warning: (77-96): The provided argument of type uint8 is not implicitly convertible to expected type bytes memory.
-// Warning: (168-184): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// Warning: (168-184): The provided argument of type uint8 is not implicitly convertible to expected type bytes memory.
-// Warning: (256-275): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
-// Warning: (256-275): The provided argument of type uint8 is not implicitly convertible to expected type bytes memory.
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).
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_event.sol b/test/libsolidity/syntaxTests/types/empty_tuple_event.sol
index 3e40b155..24327db0 100644
--- a/test/libsolidity/syntaxTests/types/empty_tuple_event.sol
+++ b/test/libsolidity/syntaxTests/types/empty_tuple_event.sol
@@ -2,9 +2,8 @@ pragma solidity ^0.4.3;
contract C {
event SomeEvent();
function a() public {
- (SomeEvent(), 7);
+ (emit SomeEvent(), 7);
}
}
// ----
-// Warning: (95-106): Invoking events without "emit" prefix is deprecated.
-// Warning: (95-106): Tuple component cannot be empty.
+// ParserError: (95-99): Expected primary expression.
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_event_050.sol b/test/libsolidity/syntaxTests/types/empty_tuple_event_050.sol
deleted file mode 100644
index aec5ff2a..00000000
--- a/test/libsolidity/syntaxTests/types/empty_tuple_event_050.sol
+++ /dev/null
@@ -1,10 +0,0 @@
-pragma experimental "v0.5.0";
-contract C {
- event SomeEvent();
- function a() public {
- (SomeEvent(), 7);
- }
-}
-// ----
-// TypeError: (101-112): Event invocations have to be prefixed by "emit".
-// TypeError: (101-112): Tuple component cannot be empty.
diff --git a/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol b/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol
index dbefb8b6..51e36a58 100644
--- a/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol
+++ b/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol
@@ -3,16 +3,16 @@ contract C {
address(this).transfer(1);
require(address(this).send(2));
selfdestruct(address(this));
- require(address(this).delegatecall());
- require(address(this).call());
+ require(address(this).delegatecall(""));
+ require(address(this).call(""));
}
function g() pure public {
bytes32 x = keccak256("abc");
bytes32 y = sha256("abc");
- address z = ecrecover(1, 2, 3, 4);
+ address z = ecrecover(bytes32(1), uint8(2), bytes32(3), bytes32(4));
require(true);
assert(true);
x; y; z;
}
- function() payable public {}
+ function() payable external {}
}