aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/syntaxTests')
-rw-r--r--test/libsolidity/syntaxTests/constructor/constructor_visibility_new.sol4
-rw-r--r--test/libsolidity/syntaxTests/constructor/constructor_visibility_old.sol6
-rw-r--r--test/libsolidity/syntaxTests/controlFlow/storageReturn/default_location.sol10
-rw-r--r--test/libsolidity/syntaxTests/fallback/default_visibility.sol2
-rw-r--r--test/libsolidity/syntaxTests/functionCalls/named_arguments_for_functions_that_take_arbitrary_parameters.sol7
-rw-r--r--test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol2
-rw-r--r--test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses_V050.sol9
-rw-r--r--test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol2
-rw-r--r--test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol4
-rw-r--r--test/libsolidity/syntaxTests/inlineAssembly/storage_reference_fine.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/039_functions_with_identical_structs_in_interface.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/040_functions_with_different_structs_in_interface.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/041_functions_with_stucts_of_non_external_types_in_interface.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/042_functions_with_stucts_of_non_external_types_in_interface_2.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/043_functions_with_stucts_of_non_external_types_in_interface_nested.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/044_returning_multi_dimensional_arrays_new_abi.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/045_returning_multi_dimensional_arrays.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/046_returning_multi_dimensional_static_arrays.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/047_returning_arrays_in_structs_new_abi.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/048_returning_arrays_in_structs_arrays.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/105_constant_input_parameter.sol8
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/208_assignment_mem_to_local_storage_variable.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/214_assignment_mem_storage_variable_directly.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/215_function_argument_mem_to_storage.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/216_function_argument_storage_to_mem.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/224_string_bytes_conversion.sol14
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/244_tuples.sol8
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/260_library_memory_struct.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/268_function_overload_array_type.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/270_inline_array_declaration_and_passing_implicit_conversion_strings.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/272_inline_array_declaration_const_string_conversion.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/274_inline_array_declaration_no_type_strings.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/403_return_structs.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/404_read_returned_struct.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/412_early_exit_on_fatal_errors.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/477_too_large_arrays_for_calldata_internal.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/478_too_large_arrays_for_calldata_public.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/514_using_for_with_non_library.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/526_fallback_marked_external_v050.sol4
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/527_fallback_marked_internal.sol1
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/527_fallback_marked_internal_v050.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private.sol1
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private_v050.sol6
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public.sol1
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public_v050.sol6
-rw-r--r--test/libsolidity/syntaxTests/parsing/tuples.sol14
-rw-r--r--test/libsolidity/syntaxTests/scoping/double_variable_declaration_same_and_disjoint_scope.sol10
-rw-r--r--test/libsolidity/syntaxTests/scoping/double_variable_declaration_same_scope.sol8
-rw-r--r--test/libsolidity/syntaxTests/scoping/poly_variable_declaration_same_scope.sol16
-rw-r--r--test/libsolidity/syntaxTests/structs/recursion/multi_struct_composition.sol2
-rw-r--r--test/libsolidity/syntaxTests/structs/recursion/parallel_structs.sol2
-rw-r--r--test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs.sol2
-rw-r--r--test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs2.sol2
-rw-r--r--test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs3.sol4
-rw-r--r--test/libsolidity/syntaxTests/tight_packing_literals.sol4
-rw-r--r--test/libsolidity/syntaxTests/tight_packing_literals_050.sol9
-rw-r--r--test/libsolidity/syntaxTests/tight_packing_literals_fine.sol4
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_function.sol4
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_function_050.sol11
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_lvalue.sol4
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_lvalue_050.sol11
-rw-r--r--test/libsolidity/syntaxTests/types/no_singleton_tuple.sol8
-rw-r--r--test/libsolidity/syntaxTests/types/rational_number_exp_limit_fail.sol (renamed from test/libsolidity/syntaxTests/types/rational_number_exp_limit.sol)43
-rw-r--r--test/libsolidity/syntaxTests/types/rational_number_exp_limit_fine.sol9
-rw-r--r--test/libsolidity/syntaxTests/types/var_type_suggest.sol23
-rw-r--r--test/libsolidity/syntaxTests/viewPure/view_pure_abi_encode.sol2
-rw-r--r--test/libsolidity/syntaxTests/viewPure/view_pure_abi_encode_arguments.sol20
68 files changed, 211 insertions, 192 deletions
diff --git a/test/libsolidity/syntaxTests/constructor/constructor_visibility_new.sol b/test/libsolidity/syntaxTests/constructor/constructor_visibility_new.sol
index 502dc029..f9c4b9b9 100644
--- a/test/libsolidity/syntaxTests/constructor/constructor_visibility_new.sol
+++ b/test/libsolidity/syntaxTests/constructor/constructor_visibility_new.sol
@@ -1,5 +1,5 @@
// The constructor of a base class should not be visible in the derived class
-contract A { constructor(string) public { } }
+contract A { constructor(string memory) public { } }
contract B is A {
function f() pure public {
A x = A(0); // convert from address
@@ -9,4 +9,4 @@ contract B is A {
}
}
// ----
-// TypeError: (243-247): Explicit type conversion not allowed from "string memory" to "contract A".
+// TypeError: (250-254): Explicit type conversion not allowed from "string memory" to "contract A".
diff --git a/test/libsolidity/syntaxTests/constructor/constructor_visibility_old.sol b/test/libsolidity/syntaxTests/constructor/constructor_visibility_old.sol
index 847ea27b..65f989b0 100644
--- a/test/libsolidity/syntaxTests/constructor/constructor_visibility_old.sol
+++ b/test/libsolidity/syntaxTests/constructor/constructor_visibility_old.sol
@@ -1,5 +1,5 @@
// The constructor of a base class should not be visible in the derived class
-contract A { function A(string s) public { } }
+contract A { function A(string memory s) public { } }
contract B is A {
function f() pure public {
A x = A(0); // convert from address
@@ -9,5 +9,5 @@ contract B is A {
}
}
// ----
-// Warning: (91-122): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
-// TypeError: (244-248): Explicit type conversion not allowed from "string memory" to "contract A".
+// Warning: (91-129): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
+// TypeError: (251-255): Explicit type conversion not allowed from "string memory" to "contract A".
diff --git a/test/libsolidity/syntaxTests/controlFlow/storageReturn/default_location.sol b/test/libsolidity/syntaxTests/controlFlow/storageReturn/default_location.sol
index 9a42192d..ec83c596 100644
--- a/test/libsolidity/syntaxTests/controlFlow/storageReturn/default_location.sol
+++ b/test/libsolidity/syntaxTests/controlFlow/storageReturn/default_location.sol
@@ -1,18 +1,18 @@
contract C {
struct S { bool f; }
S s;
- function f() internal view returns (S c) {
+ function f() internal view returns (S memory c) {
c = s;
}
- function g() internal view returns (S) {
+ function g() internal view returns (S memory) {
return s;
}
- function h() internal pure returns (S) {
+ function h() internal pure returns (S memory) {
}
- function i(bool flag) internal view returns (S c) {
+ function i(bool flag) internal view returns (S memory c) {
if (flag) c = s;
}
- function j(bool flag) internal view returns (S) {
+ function j(bool flag) internal view returns (S memory) {
if (flag) return s;
}
}
diff --git a/test/libsolidity/syntaxTests/fallback/default_visibility.sol b/test/libsolidity/syntaxTests/fallback/default_visibility.sol
index f45bbd3c..31123d59 100644
--- a/test/libsolidity/syntaxTests/fallback/default_visibility.sol
+++ b/test/libsolidity/syntaxTests/fallback/default_visibility.sol
@@ -3,4 +3,4 @@ contract C {
function() {}
}
// ----
-// Warning: (90-103): No visibility specified. Defaulting to "public".
+// TypeError: (90-103): Fallback function must be defined as "external".
diff --git a/test/libsolidity/syntaxTests/functionCalls/named_arguments_for_functions_that_take_arbitrary_parameters.sol b/test/libsolidity/syntaxTests/functionCalls/named_arguments_for_functions_that_take_arbitrary_parameters.sol
new file mode 100644
index 00000000..089e1dbf
--- /dev/null
+++ b/test/libsolidity/syntaxTests/functionCalls/named_arguments_for_functions_that_take_arbitrary_parameters.sol
@@ -0,0 +1,7 @@
+contract C {
+ function f() pure public {
+ abi.encodeWithSelector({selector:"abc"});
+ }
+}
+// ----
+// TypeError: (52-92): Named arguments cannot be used for functions that take arbitrary parameters.
diff --git a/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol b/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol
index 0b18b995..692b1827 100644
--- a/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol
+++ b/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses.sol
@@ -4,4 +4,4 @@ contract Base {
contract Derived is Base(2) { }
contract Derived2 is Base(), Derived() { }
// ----
-// Warning: (101-107): Wrong argument count for constructor call: 0 arguments given but expected 1.
+// TypeError: (101-107): Wrong argument count for constructor call: 0 arguments given but expected 1. Remove parentheses if you do not want to provide arguments here.
diff --git a/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses_V050.sol b/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses_V050.sol
deleted file mode 100644
index db04ab8c..00000000
--- a/test/libsolidity/syntaxTests/inheritance/base_arguments_empty_parentheses_V050.sol
+++ /dev/null
@@ -1,9 +0,0 @@
-pragma experimental "v0.5.0";
-
-contract Base {
- constructor(uint) public {}
-}
-contract Derived is Base(2) { }
-contract Derived2 is Base(), Derived() { }
-// ----
-// TypeError: (132-138): Wrong argument count for constructor call: 0 arguments given but expected 1.
diff --git a/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol b/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol
index c55c41f2..1ce48200 100644
--- a/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol
+++ b/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol
@@ -6,5 +6,5 @@ contract Derived2 is Base {
constructor() Base(2) public { }
}
// ----
-// TypeError: (74-81): Wrong argument count for constructor call: 1 arguments given but expected 2.
+// TypeError: (74-81): Wrong argument count for constructor call: 1 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here.
// TypeError: (130-137): Wrong argument count for modifier invocation: 1 arguments given but expected 2.
diff --git a/test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol
index 55c83674..b6dd12b8 100644
--- a/test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol
+++ b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol
@@ -1,6 +1,6 @@
contract C {
uint[] x;
- function() public {
+ function() external {
uint[] storage y = x;
assembly {
pop(y)
@@ -8,4 +8,4 @@ contract C {
}
}
// ----
-// TypeError: (117-118): You have to use the _slot or _offset suffix to access storage reference variables.
+// TypeError: (119-120): You have to use the _slot or _offset suffix to access storage reference variables.
diff --git a/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_fine.sol b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_fine.sol
index 3ae24b34..84f98ed9 100644
--- a/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_fine.sol
+++ b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_fine.sol
@@ -1,6 +1,6 @@
contract C {
uint[] x;
- function() public {
+ function() external {
uint[] storage y = x;
assembly {
pop(y_slot)
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/039_functions_with_identical_structs_in_interface.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/039_functions_with_identical_structs_in_interface.sol
index 851ccf89..3389ffe4 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/039_functions_with_identical_structs_in_interface.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/039_functions_with_identical_structs_in_interface.sol
@@ -3,9 +3,9 @@ pragma experimental ABIEncoderV2;
contract C {
struct S1 { int i; }
struct S2 { int i; }
- function f(S1) public pure {}
- function f(S2) public pure {}
+ function f(S1 memory) public pure {}
+ function f(S2 memory) public pure {}
}
// ----
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
-// TypeError: (136-165): Function overload clash during conversion to external types for arguments.
+// TypeError: (143-179): Function overload clash during conversion to external types for arguments.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/040_functions_with_different_structs_in_interface.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/040_functions_with_different_structs_in_interface.sol
index 1689e6f5..6ff8fd6e 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/040_functions_with_different_structs_in_interface.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/040_functions_with_different_structs_in_interface.sol
@@ -3,8 +3,8 @@ pragma experimental ABIEncoderV2;
contract C {
struct S1 { function() external a; }
struct S2 { bytes24 a; }
- function f(S1) public pure {}
- function f(S2) public pure {}
+ function f(S1 memory) public pure {}
+ function f(S2 memory) public pure {}
}
// ----
-// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
+// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments. \ No newline at end of file
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/041_functions_with_stucts_of_non_external_types_in_interface.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/041_functions_with_stucts_of_non_external_types_in_interface.sol
index 775258c2..9fd09dd7 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/041_functions_with_stucts_of_non_external_types_in_interface.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/041_functions_with_stucts_of_non_external_types_in_interface.sol
@@ -2,7 +2,7 @@ pragma experimental ABIEncoderV2;
contract C {
struct S { function() internal a; }
- function f(S) public {}
+ function f(S memory) public {}
}
// ----
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/042_functions_with_stucts_of_non_external_types_in_interface_2.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/042_functions_with_stucts_of_non_external_types_in_interface_2.sol
index 4a95430f..435a02ef 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/042_functions_with_stucts_of_non_external_types_in_interface_2.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/042_functions_with_stucts_of_non_external_types_in_interface_2.sol
@@ -2,7 +2,7 @@ pragma experimental ABIEncoderV2;
contract C {
struct S { mapping(uint => uint) a; }
- function f(S) public {}
+ function f(S memory) public {}
}
// ----
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/043_functions_with_stucts_of_non_external_types_in_interface_nested.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/043_functions_with_stucts_of_non_external_types_in_interface_nested.sol
index 09cd38b5..b9dc7c2e 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/043_functions_with_stucts_of_non_external_types_in_interface_nested.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/043_functions_with_stucts_of_non_external_types_in_interface_nested.sol
@@ -3,7 +3,7 @@ pragma experimental ABIEncoderV2;
contract C {
struct T { mapping(uint => uint) a; }
struct S { T[][2] b; }
- function f(S) public {}
+ function f(S memory) public {}
}
// ----
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/044_returning_multi_dimensional_arrays_new_abi.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/044_returning_multi_dimensional_arrays_new_abi.sol
index e54e27e9..ae9416e5 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/044_returning_multi_dimensional_arrays_new_abi.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/044_returning_multi_dimensional_arrays_new_abi.sol
@@ -1,7 +1,7 @@
pragma experimental ABIEncoderV2;
contract C {
- function f() public pure returns (string[][]) {}
+ function f() public pure returns (string[][] memory) {}
}
// ----
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/045_returning_multi_dimensional_arrays.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/045_returning_multi_dimensional_arrays.sol
index daa67836..221e5fa4 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/045_returning_multi_dimensional_arrays.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/045_returning_multi_dimensional_arrays.sol
@@ -1,5 +1,5 @@
contract C {
- function f() public pure returns (string[][]) {}
+ function f() public pure returns (string[][] memory) {}
}
// ----
// TypeError: (51-61): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/046_returning_multi_dimensional_static_arrays.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/046_returning_multi_dimensional_static_arrays.sol
index 26af7436..75423bc9 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/046_returning_multi_dimensional_static_arrays.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/046_returning_multi_dimensional_static_arrays.sol
@@ -1,5 +1,5 @@
contract C {
- function f() public pure returns (uint[][2]) {}
+ function f() public pure returns (uint[][2] memory) {}
}
// ----
// TypeError: (51-60): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/047_returning_arrays_in_structs_new_abi.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/047_returning_arrays_in_structs_new_abi.sol
index 81628a12..8ca3a53d 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/047_returning_arrays_in_structs_new_abi.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/047_returning_arrays_in_structs_new_abi.sol
@@ -2,7 +2,7 @@ pragma experimental ABIEncoderV2;
contract C {
struct S { string[] s; }
- function f() public pure returns (S) {}
+ function f() public pure returns (S memory) {}
}
// ----
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/048_returning_arrays_in_structs_arrays.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/048_returning_arrays_in_structs_arrays.sol
index 2f1e5a15..48e80fcf 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/048_returning_arrays_in_structs_arrays.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/048_returning_arrays_in_structs_arrays.sol
@@ -1,6 +1,6 @@
contract C {
struct S { string[] s; }
- function f() public pure returns (S x) {}
+ function f() public pure returns (S memory x) {}
}
// ----
-// TypeError: (80-83): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature.
+// TypeError: (80-90): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/105_constant_input_parameter.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/105_constant_input_parameter.sol
index 636d325f..df47aa6b 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/105_constant_input_parameter.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/105_constant_input_parameter.sol
@@ -1,7 +1,7 @@
contract test {
- function f(uint[] constant a) public { }
+ function f(uint[] memory constant a) public { }
}
// ----
-// TypeError: (31-48): Illegal use of "constant" specifier.
-// TypeError: (31-48): Constants of non-value type not yet implemented.
-// TypeError: (31-48): Uninitialized "constant" variable.
+// TypeError: (31-55): Illegal use of "constant" specifier.
+// TypeError: (31-55): Constants of non-value type not yet implemented.
+// TypeError: (31-55): Uninitialized "constant" variable.
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 febe39e6..cf303772 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,9 +1,9 @@
contract C {
uint[] data;
- function f(uint[] x) public {
+ function f(uint[] memory x) public {
uint[] storage dataRef = data;
dataRef = x;
}
}
// ----
-// TypeError: (121-122): Type uint256[] memory is not implicitly convertible to expected type uint256[] storage pointer.
+// TypeError: (128-129): Type uint256[] memory is not implicitly convertible to expected type uint256[] storage pointer.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/214_assignment_mem_storage_variable_directly.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/214_assignment_mem_storage_variable_directly.sol
index 08737f2d..801eb275 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/214_assignment_mem_storage_variable_directly.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/214_assignment_mem_storage_variable_directly.sol
@@ -1,6 +1,6 @@
contract C {
uint[] data;
- function f(uint[] x) public {
+ function f(uint[] memory x) public {
data = x;
}
}
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/215_function_argument_mem_to_storage.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/215_function_argument_mem_to_storage.sol
index 4d75732a..984b81b1 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/215_function_argument_mem_to_storage.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/215_function_argument_mem_to_storage.sol
@@ -1,9 +1,9 @@
contract C {
function f(uint[] storage x) private {
}
- function g(uint[] x) public {
+ function g(uint[] memory x) public {
f(x);
}
}
// ----
-// TypeError: (106-107): Invalid type for argument in function call. Invalid implicit conversion from uint256[] memory to uint256[] storage pointer requested.
+// TypeError: (113-114): Invalid type for argument in function call. Invalid implicit conversion from uint256[] memory to uint256[] storage pointer requested.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/216_function_argument_storage_to_mem.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/216_function_argument_storage_to_mem.sol
index 157ef4dd..c5175a41 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/216_function_argument_storage_to_mem.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/216_function_argument_storage_to_mem.sol
@@ -2,9 +2,9 @@ contract C {
function f(uint[] storage x) private {
g(x);
}
- function g(uint[] x) public {
+ function g(uint[] memory x) public {
}
}
// ----
-// Warning: (91-99): Unused function parameter. Remove or comment out the variable name to silence this warning.
-// Warning: (80-115): Function state mutability can be restricted to pure
+// Warning: (91-106): Unused function parameter. Remove or comment out the variable name to silence this warning.
+// Warning: (80-122): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/224_string_bytes_conversion.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/224_string_bytes_conversion.sol
index 137aa893..7b953abb 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/224_string_bytes_conversion.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/224_string_bytes_conversion.sol
@@ -2,16 +2,16 @@ contract Test {
string s;
bytes b;
function h(string _s) external { bytes(_s).length; }
- function i(string _s) internal { bytes(_s).length; }
+ function i(string memory _s) internal { bytes(_s).length; }
function j() internal { bytes(s).length; }
function k(bytes _b) external { string(_b); }
- function l(bytes _b) internal { string(_b); }
+ function l(bytes memory _b) internal { string(_b); }
function m() internal { string(b); }
}
// ----
// Warning: (47-99): Function state mutability can be restricted to pure
-// Warning: (104-156): Function state mutability can be restricted to pure
-// Warning: (161-203): Function state mutability can be restricted to view
-// Warning: (208-253): Function state mutability can be restricted to pure
-// Warning: (258-303): Function state mutability can be restricted to pure
-// Warning: (308-344): Function state mutability can be restricted to view
+// Warning: (104-163): Function state mutability can be restricted to pure
+// Warning: (168-210): Function state mutability can be restricted to view
+// Warning: (215-260): Function state mutability can be restricted to pure
+// Warning: (265-317): Function state mutability can be restricted to pure
+// Warning: (322-358): Function state mutability can be restricted to view
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/244_tuples.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/244_tuples.sol
index 3112f67a..95e8cf37 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/244_tuples.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/244_tuples.sol
@@ -1,13 +1,13 @@
contract C {
function f() public {
uint a = (1);
- (uint b,) = (uint8(1),);
+ (uint b,) = uint8(1);
(uint c, uint d) = (uint32(1), 2 + a);
(uint e,) = (uint64(1), 2, b);
a;b;c;d;e;
}
}
// ----
-// 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
+// Warning: (69-89): Different number of components on the left hand side (2) than on the right hand side (1).
+// Warning: (146-175): Different number of components on the left hand side (2) than on the right hand side (3).
+// Warning: (17-201): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/260_library_memory_struct.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/260_library_memory_struct.sol
index e06ba2d1..20d8afa5 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/260_library_memory_struct.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/260_library_memory_struct.sol
@@ -1,8 +1,8 @@
pragma experimental ABIEncoderV2;
library c {
struct S { uint x; }
- function f() public returns (S ) {}
+ function f() public returns (S memory) {}
}
// ----
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
-// Warning: (75-110): Function state mutability can be restricted to pure
+// Warning: (75-116): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/268_function_overload_array_type.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/268_function_overload_array_type.sol
index 97e68aa3..4fc9d46e 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/268_function_overload_array_type.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/268_function_overload_array_type.sol
@@ -1,4 +1,4 @@
contract M {
- function f(uint[]) public;
- function f(int[]) public;
+ function f(uint[] memory) public;
+ function f(int[] memory) public;
}
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/270_inline_array_declaration_and_passing_implicit_conversion_strings.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/270_inline_array_declaration_and_passing_implicit_conversion_strings.sol
index d7765d7b..025244d3 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/270_inline_array_declaration_and_passing_implicit_conversion_strings.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/270_inline_array_declaration_and_passing_implicit_conversion_strings.sol
@@ -1,5 +1,5 @@
contract C {
- function f() public returns (string) {
+ function f() public returns (string memory) {
string memory x = "Hello";
string memory y = "World";
string[2] memory z = [x, y];
@@ -7,4 +7,4 @@ contract C {
}
}
// ----
-// Warning: (17-191): Function state mutability can be restricted to pure
+// Warning: (17-198): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/272_inline_array_declaration_const_string_conversion.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/272_inline_array_declaration_const_string_conversion.sol
index dd39af85..4e92f6e1 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/272_inline_array_declaration_const_string_conversion.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/272_inline_array_declaration_const_string_conversion.sol
@@ -1,8 +1,8 @@
contract C {
- function f() public returns (string) {
+ function f() public returns (string memory) {
string[2] memory z = ["Hello", "World"];
return (z[0]);
}
}
// ----
-// Warning: (17-133): Function state mutability can be restricted to pure
+// Warning: (17-140): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/274_inline_array_declaration_no_type_strings.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/274_inline_array_declaration_no_type_strings.sol
index fbc028c5..6d36942d 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/274_inline_array_declaration_no_type_strings.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/274_inline_array_declaration_no_type_strings.sol
@@ -1,7 +1,7 @@
contract C {
- function f() public returns (string) {
+ function f() public returns (string memory) {
return (["foo", "man", "choo"][1]);
}
}
// ----
-// Warning: (17-105): Function state mutability can be restricted to pure
+// Warning: (17-112): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/403_return_structs.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/403_return_structs.sol
index 8af8098c..2575954e 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/403_return_structs.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/403_return_structs.sol
@@ -2,9 +2,9 @@ pragma experimental ABIEncoderV2;
contract C {
struct S { uint a; T[] sub; }
struct T { uint[] x; }
- function f() public returns (uint, S) {
+ function f() public returns (uint, S memory) {
}
}
// ----
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
-// Warning: (112-157): Function state mutability can be restricted to pure
+// Warning: (112-164): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/404_read_returned_struct.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/404_read_returned_struct.sol
index dd16eae4..52d1bd13 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/404_read_returned_struct.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/404_read_returned_struct.sol
@@ -4,7 +4,7 @@ contract A {
int x;
int y;
}
- function g() public returns (T) {
+ function g() public returns (T memory) {
return this.g();
}
}
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/412_early_exit_on_fatal_errors.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/412_early_exit_on_fatal_errors.sol
index 8e5d81e2..56fc4051 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/412_early_exit_on_fatal_errors.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/412_early_exit_on_fatal_errors.sol
@@ -1,4 +1,4 @@
-// This tests a crash that occured because we did not stop for fatal errors.
+// This tests a crash that occurred because we did not stop for fatal errors.
contract C {
struct S {
ftring a;
@@ -8,4 +8,4 @@ contract C {
}
}
// ----
-// DeclarationError: (113-119): Identifier not found or not unique.
+// DeclarationError: (114-120): Identifier not found or not unique.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/477_too_large_arrays_for_calldata_internal.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/477_too_large_arrays_for_calldata_internal.sol
index ab57f489..7578246e 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/477_too_large_arrays_for_calldata_internal.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/477_too_large_arrays_for_calldata_internal.sol
@@ -1,6 +1,6 @@
contract C {
- function f(uint[85678901234] a) pure internal {
+ function f(uint[85678901234] memory a) pure internal {
}
}
// ----
-// TypeError: (28-47): Array is too large to be encoded.
+// TypeError: (28-54): Array is too large to be encoded.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/478_too_large_arrays_for_calldata_public.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/478_too_large_arrays_for_calldata_public.sol
index 1493f3ca..2831b6fb 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/478_too_large_arrays_for_calldata_public.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/478_too_large_arrays_for_calldata_public.sol
@@ -1,6 +1,6 @@
contract C {
- function f(uint[85678901234] a) pure public {
+ function f(uint[85678901234] memory a) pure public {
}
}
// ----
-// TypeError: (28-47): Array is too large to be encoded.
+// TypeError: (28-54): Array is too large to be encoded.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/514_using_for_with_non_library.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/514_using_for_with_non_library.sol
index ab139dd5..7e9612d0 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/514_using_for_with_non_library.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/514_using_for_with_non_library.sol
@@ -2,7 +2,7 @@
library L {
struct S { uint d; }
using S for S;
- function f(S _s) internal {
+ function f(S memory _s) internal {
_s.d = 1;
}
}
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol
index d65c639f..ad08eca6 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol
@@ -1,4 +1,4 @@
interface I {}
contract C is I(2) {}
// ----
-// TypeError: (29-33): Wrong argument count for constructor call: 1 arguments given but expected 0.
+// TypeError: (29-33): Wrong argument count for constructor call: 1 arguments given but expected 0. Remove parentheses if you do not want to provide arguments here.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/526_fallback_marked_external_v050.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/526_fallback_marked_external_v050.sol
deleted file mode 100644
index f13a87ec..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/526_fallback_marked_external_v050.sol
+++ /dev/null
@@ -1,4 +0,0 @@
-pragma experimental "v0.5.0";
-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
index 2d425037..b8e1c654 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/527_fallback_marked_internal.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/527_fallback_marked_internal.sol
@@ -2,3 +2,4 @@ contract C {
function () internal { }
}
// ----
+// TypeError: (17-41): Fallback function must be defined as "external".
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/527_fallback_marked_internal_v050.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/527_fallback_marked_internal_v050.sol
deleted file mode 100644
index 6c8b23c8..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/527_fallback_marked_internal_v050.sol
+++ /dev/null
@@ -1,6 +0,0 @@
-pragma experimental "v0.5.0";
-contract C {
- function () internal { }
-}
-// ----
-// TypeError: (47-71): Fallback function must be defined as "external".
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private.sol
index 2105c815..6038a99f 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private.sol
@@ -2,3 +2,4 @@ contract C {
function () private { }
}
// ----
+// TypeError: (17-40): Fallback function must be defined as "external".
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private_v050.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private_v050.sol
deleted file mode 100644
index be381909..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/528_fallback_marked_private_v050.sol
+++ /dev/null
@@ -1,6 +0,0 @@
-pragma experimental "v0.5.0";
-contract C {
- function () private { }
-}
-// ----
-// TypeError: (47-70): Fallback function must be defined as "external".
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public.sol
index 42585137..d9c1580f 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public.sol
@@ -2,3 +2,4 @@ contract C {
function () public { }
}
// ----
+// TypeError: (17-39): Fallback function must be defined as "external".
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public_v050.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public_v050.sol
deleted file mode 100644
index d0beffda..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/529_fallback_marked_public_v050.sol
+++ /dev/null
@@ -1,6 +0,0 @@
-pragma experimental "v0.5.0";
-contract C {
- function () public { }
-}
-// ----
-// TypeError: (47-69): Fallback function must be defined as "external".
diff --git a/test/libsolidity/syntaxTests/parsing/tuples.sol b/test/libsolidity/syntaxTests/parsing/tuples.sol
index 8266c94f..ca2f9d6b 100644
--- a/test/libsolidity/syntaxTests/parsing/tuples.sol
+++ b/test/libsolidity/syntaxTests/parsing/tuples.sol
@@ -1,16 +1,16 @@
contract C {
function f() public {
uint a = (1);
- (uint b,) = (1,);
+ (uint b,) = 1;
(uint c, uint d) = (1, 2 + a);
(uint e,) = (1, 2, b);
(a) = 3;
}
}
// ----
-// Warning: (54-70): Different number of components on the left hand side (2) than on the right hand side (1).
-// Warning: (107-128): Different number of components on the left hand side (2) than on the right hand side (3).
-// Warning: (75-81): Unused local variable.
-// Warning: (83-89): Unused local variable.
-// Warning: (108-114): Unused local variable.
-// Warning: (14-143): Function state mutability can be restricted to pure
+// Warning: (54-67): Different number of components on the left hand side (2) than on the right hand side (1).
+// Warning: (104-125): Different number of components on the left hand side (2) than on the right hand side (3).
+// Warning: (72-78): Unused local variable.
+// Warning: (80-86): Unused local variable.
+// Warning: (105-111): Unused local variable.
+// Warning: (14-140): Function state mutability can be restricted to pure
diff --git a/test/libsolidity/syntaxTests/scoping/double_variable_declaration_same_and_disjoint_scope.sol b/test/libsolidity/syntaxTests/scoping/double_variable_declaration_same_and_disjoint_scope.sol
new file mode 100644
index 00000000..45c5ff2d
--- /dev/null
+++ b/test/libsolidity/syntaxTests/scoping/double_variable_declaration_same_and_disjoint_scope.sol
@@ -0,0 +1,10 @@
+contract test {
+ function f() pure public {
+ uint x;
+ { uint x; }
+ uint x;
+ }
+}
+// ----
+// Warning: (73-79): This declaration shadows an existing declaration.
+// DeclarationError: (91-97): Identifier already declared.
diff --git a/test/libsolidity/syntaxTests/scoping/double_variable_declaration_same_scope.sol b/test/libsolidity/syntaxTests/scoping/double_variable_declaration_same_scope.sol
new file mode 100644
index 00000000..72c31f73
--- /dev/null
+++ b/test/libsolidity/syntaxTests/scoping/double_variable_declaration_same_scope.sol
@@ -0,0 +1,8 @@
+contract test {
+ function f() pure public {
+ uint x;
+ uint x;
+ }
+}
+// ----
+// DeclarationError: (71-77): Identifier already declared.
diff --git a/test/libsolidity/syntaxTests/scoping/poly_variable_declaration_same_scope.sol b/test/libsolidity/syntaxTests/scoping/poly_variable_declaration_same_scope.sol
new file mode 100644
index 00000000..e414f611
--- /dev/null
+++ b/test/libsolidity/syntaxTests/scoping/poly_variable_declaration_same_scope.sol
@@ -0,0 +1,16 @@
+contract test {
+ function f() pure public {
+ uint x;
+ uint x;
+ uint x;
+ uint x;
+ uint x;
+ uint x;
+ }
+}
+// ----
+// DeclarationError: (71-77): Identifier already declared.
+// DeclarationError: (87-93): Identifier already declared.
+// DeclarationError: (103-109): Identifier already declared.
+// DeclarationError: (119-125): Identifier already declared.
+// DeclarationError: (135-141): Identifier already declared.
diff --git a/test/libsolidity/syntaxTests/structs/recursion/multi_struct_composition.sol b/test/libsolidity/syntaxTests/structs/recursion/multi_struct_composition.sol
index 895bb6c5..e8ece3bc 100644
--- a/test/libsolidity/syntaxTests/structs/recursion/multi_struct_composition.sol
+++ b/test/libsolidity/syntaxTests/structs/recursion/multi_struct_composition.sol
@@ -9,7 +9,7 @@ contract C {
struct W { uint x; }
- function f(T) public pure { }
+ function f(T memory) public pure { }
}
// ----
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
diff --git a/test/libsolidity/syntaxTests/structs/recursion/parallel_structs.sol b/test/libsolidity/syntaxTests/structs/recursion/parallel_structs.sol
index 96362ef0..e9b25453 100644
--- a/test/libsolidity/syntaxTests/structs/recursion/parallel_structs.sol
+++ b/test/libsolidity/syntaxTests/structs/recursion/parallel_structs.sol
@@ -9,7 +9,7 @@ contract TestContract
SubStruct subStruct1;
SubStruct subStruct2;
}
- function addTestStruct(TestStruct) public pure {}
+ function addTestStruct(TestStruct memory) public pure {}
}
// ----
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
diff --git a/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs.sol b/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs.sol
index 4966a731..89d1ddd9 100644
--- a/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs.sol
+++ b/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs.sol
@@ -1,6 +1,6 @@
contract C {
struct S { uint a; S[] sub; }
- function f() public pure returns (uint, S) {
+ function f() public pure returns (uint, S memory) {
}
}
// ----
diff --git a/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs2.sol b/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs2.sol
index 68113924..1c31e180 100644
--- a/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs2.sol
+++ b/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs2.sol
@@ -1,6 +1,6 @@
contract C {
struct S { uint a; S[2][] sub; }
- function f() public pure returns (uint, S) {
+ function f() public pure returns (uint, S memory) {
}
}
// ----
diff --git a/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs3.sol b/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs3.sol
index 47690d9b..0a5b1bc8 100644
--- a/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs3.sol
+++ b/test/libsolidity/syntaxTests/structs/recursion/return_recursive_structs3.sol
@@ -1,8 +1,8 @@
contract C {
struct S { uint a; S[][][] sub; }
struct T { S s; }
- function f() public pure returns (uint x, T t) {
+ function f() public pure returns (uint x, T memory t) {
}
}
// ----
-// TypeError: (119-122): Internal or recursive type is not allowed for public or external functions.
+// TypeError: (119-129): Internal or recursive type is not allowed for public or external functions.
diff --git a/test/libsolidity/syntaxTests/tight_packing_literals.sol b/test/libsolidity/syntaxTests/tight_packing_literals.sol
index be8482ff..0fc1fc08 100644
--- a/test/libsolidity/syntaxTests/tight_packing_literals.sol
+++ b/test/libsolidity/syntaxTests/tight_packing_literals.sol
@@ -1,8 +1,8 @@
contract C {
- function k() pure public returns (bytes) {
+ function k() pure public returns (bytes memory) {
return abi.encodePacked(1);
}
}
// ----
-// 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.
+// TypeError: (99-100): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.
diff --git a/test/libsolidity/syntaxTests/tight_packing_literals_050.sol b/test/libsolidity/syntaxTests/tight_packing_literals_050.sol
deleted file mode 100644
index 4e6210c6..00000000
--- a/test/libsolidity/syntaxTests/tight_packing_literals_050.sol
+++ /dev/null
@@ -1,9 +0,0 @@
-pragma experimental "v0.5.0";
-contract C {
- function k() pure public returns (bytes) {
- return abi.encodePacked(1);
- }
-}
-
-// ----
-// 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 7bbc36d0..45fc1f72 100644
--- a/test/libsolidity/syntaxTests/tight_packing_literals_fine.sol
+++ b/test/libsolidity/syntaxTests/tight_packing_literals_fine.sol
@@ -1,8 +1,8 @@
contract C {
- function k() pure public returns (bytes) {
+ function k() pure public returns (bytes memory) {
return abi.encodePacked(uint8(1));
}
- function l() pure public returns (bytes) {
+ function l() pure public returns (bytes memory) {
return abi.encode(1);
}
}
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_function.sol b/test/libsolidity/syntaxTests/types/empty_tuple_function.sol
index 05b54442..ff31d440 100644
--- a/test/libsolidity/syntaxTests/types/empty_tuple_function.sol
+++ b/test/libsolidity/syntaxTests/types/empty_tuple_function.sol
@@ -8,5 +8,5 @@ contract C {
}
}
// ----
-// Warning: (162-165): Tuple component cannot be empty.
-// Warning: (181-184): Tuple component cannot be empty.
+// TypeError: (162-165): Tuple component cannot be empty.
+// TypeError: (181-184): Tuple component cannot be empty.
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_function_050.sol b/test/libsolidity/syntaxTests/types/empty_tuple_function_050.sol
deleted file mode 100644
index c4b9e03f..00000000
--- a/test/libsolidity/syntaxTests/types/empty_tuple_function_050.sol
+++ /dev/null
@@ -1,11 +0,0 @@
-pragma experimental "v0.5.0";
-contract C {
- function f() private pure {}
- function a() public pure {
- bool x = true;
- bool y = true;
- (x) ? (f(), y = false) : (f(), y = false);
- }
-}
-// ----
-// TypeError: (168-171): Tuple component cannot be empty.
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_lvalue.sol b/test/libsolidity/syntaxTests/types/empty_tuple_lvalue.sol
index cba30c1b..3d252f0b 100644
--- a/test/libsolidity/syntaxTests/types/empty_tuple_lvalue.sol
+++ b/test/libsolidity/syntaxTests/types/empty_tuple_lvalue.sol
@@ -8,6 +8,6 @@ contract C {
}
}
// ----
-// Warning: (146-149): Tuple component cannot be empty.
-// Warning: (151-154): Tuple component cannot be empty.
+// TypeError: (146-149): Tuple component cannot be empty.
+// TypeError: (151-154): Tuple component cannot be empty.
// TypeError: (145-155): Type tuple(tuple(),tuple()) is not implicitly convertible to expected type tuple(uint256,uint256).
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_050.sol b/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_050.sol
deleted file mode 100644
index b0691778..00000000
--- a/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_050.sol
+++ /dev/null
@@ -1,11 +0,0 @@
-pragma experimental "v0.5.0";
-contract C {
- function f() private pure {}
- function a() public {
- uint x;
- uint y;
- (x, y) = (f(), f());
- }
-}
-// ----
-// TypeError: (152-155): Tuple component cannot be empty.
diff --git a/test/libsolidity/syntaxTests/types/no_singleton_tuple.sol b/test/libsolidity/syntaxTests/types/no_singleton_tuple.sol
new file mode 100644
index 00000000..62a58f83
--- /dev/null
+++ b/test/libsolidity/syntaxTests/types/no_singleton_tuple.sol
@@ -0,0 +1,8 @@
+contract C {
+ function f() public pure {
+ uint a;
+ (a,) = (uint(1),);
+ }
+}
+// ----
+// TypeError: (60-70): Tuple component cannot be empty.
diff --git a/test/libsolidity/syntaxTests/types/rational_number_exp_limit.sol b/test/libsolidity/syntaxTests/types/rational_number_exp_limit_fail.sol
index 6785f580..058db2e9 100644
--- a/test/libsolidity/syntaxTests/types/rational_number_exp_limit.sol
+++ b/test/libsolidity/syntaxTests/types/rational_number_exp_limit_fail.sol
@@ -4,9 +4,6 @@ contract c {
a = 4 ** 4 ** 2 ** 4 ** 4 ** 4 ** 4;
a = -4 ** 4 ** 2 ** 4 ** 4 ** 4 ** 4 ** 4;
a = 4 ** (-(2 ** 4 ** 4 ** 4 ** 4 ** 4));
- a = 0 ** 1E1233; // fine
- a = 1 ** 1E1233; // fine
- a = -1 ** 1E1233; // fine
a = 2 ** 1E1233;
a = -2 ** 1E1233;
a = 2 ** -1E1233;
@@ -28,23 +25,23 @@ contract c {
// TypeError: (116-153): Operator ** not compatible with types int_const 1797...(301 digits omitted)...7216 and int_const 4
// TypeError: (116-153): Type int_const 1797...(301 digits omitted)...7216 is not implicitly convertible to expected type int256.
// TypeError: (167-203): Operator ** not compatible with types int_const 4 and int_const -179...(302 digits omitted)...7216
-// TypeError: (317-328): Operator ** not compatible with types int_const 2 and int_const 1000...(1226 digits omitted)...0000
-// TypeError: (342-354): Operator ** not compatible with types int_const -2 and int_const 1000...(1226 digits omitted)...0000
-// TypeError: (368-380): Operator ** not compatible with types int_const 2 and int_const -100...(1227 digits omitted)...0000
-// TypeError: (394-407): Operator ** not compatible with types int_const -2 and int_const -100...(1227 digits omitted)...0000
-// TypeError: (421-432): Operator ** not compatible with types int_const 1000...(1226 digits omitted)...0000 and int_const 2
-// TypeError: (421-432): Type int_const 1000...(1226 digits omitted)...0000 is not implicitly convertible to expected type int256.
-// TypeError: (446-458): Operator ** not compatible with types int_const -100...(1227 digits omitted)...0000 and int_const 2
-// TypeError: (446-458): Type int_const -100...(1227 digits omitted)...0000 is not implicitly convertible to expected type int256.
-// TypeError: (472-484): Operator ** not compatible with types int_const 1000...(1226 digits omitted)...0000 and int_const -2
-// TypeError: (472-484): Type int_const 1000...(1226 digits omitted)...0000 is not implicitly convertible to expected type int256.
-// TypeError: (498-511): Operator ** not compatible with types int_const -100...(1227 digits omitted)...0000 and int_const -2
-// TypeError: (498-511): Type int_const -100...(1227 digits omitted)...0000 is not implicitly convertible to expected type int256.
-// TypeError: (525-541): Operator ** not compatible with types int_const 1000...(1226 digits omitted)...0000 and int_const 1000...(1226 digits omitted)...0000
-// TypeError: (525-541): Type int_const 1000...(1226 digits omitted)...0000 is not implicitly convertible to expected type int256.
-// TypeError: (555-572): Operator ** not compatible with types int_const 1000...(1226 digits omitted)...0000 and int_const -100...(1227 digits omitted)...0000
-// TypeError: (555-572): Type int_const 1000...(1226 digits omitted)...0000 is not implicitly convertible to expected type int256.
-// TypeError: (586-603): Operator ** not compatible with types int_const -100...(1227 digits omitted)...0000 and int_const 1000...(1226 digits omitted)...0000
-// TypeError: (586-603): Type int_const -100...(1227 digits omitted)...0000 is not implicitly convertible to expected type int256.
-// TypeError: (617-635): Operator ** not compatible with types int_const -100...(1227 digits omitted)...0000 and int_const -100...(1227 digits omitted)...0000
-// TypeError: (617-635): Type int_const -100...(1227 digits omitted)...0000 is not implicitly convertible to expected type int256.
+// TypeError: (217-228): Operator ** not compatible with types int_const 2 and int_const 1000...(1226 digits omitted)...0000
+// TypeError: (242-254): Operator ** not compatible with types int_const -2 and int_const 1000...(1226 digits omitted)...0000
+// TypeError: (268-280): Operator ** not compatible with types int_const 2 and int_const -100...(1227 digits omitted)...0000
+// TypeError: (294-307): Operator ** not compatible with types int_const -2 and int_const -100...(1227 digits omitted)...0000
+// TypeError: (321-332): Operator ** not compatible with types int_const 1000...(1226 digits omitted)...0000 and int_const 2
+// TypeError: (321-332): Type int_const 1000...(1226 digits omitted)...0000 is not implicitly convertible to expected type int256.
+// TypeError: (346-358): Operator ** not compatible with types int_const -100...(1227 digits omitted)...0000 and int_const 2
+// TypeError: (346-358): Type int_const -100...(1227 digits omitted)...0000 is not implicitly convertible to expected type int256.
+// TypeError: (372-384): Operator ** not compatible with types int_const 1000...(1226 digits omitted)...0000 and int_const -2
+// TypeError: (372-384): Type int_const 1000...(1226 digits omitted)...0000 is not implicitly convertible to expected type int256.
+// TypeError: (398-411): Operator ** not compatible with types int_const -100...(1227 digits omitted)...0000 and int_const -2
+// TypeError: (398-411): Type int_const -100...(1227 digits omitted)...0000 is not implicitly convertible to expected type int256.
+// TypeError: (425-441): Operator ** not compatible with types int_const 1000...(1226 digits omitted)...0000 and int_const 1000...(1226 digits omitted)...0000
+// TypeError: (425-441): Type int_const 1000...(1226 digits omitted)...0000 is not implicitly convertible to expected type int256.
+// TypeError: (455-472): Operator ** not compatible with types int_const 1000...(1226 digits omitted)...0000 and int_const -100...(1227 digits omitted)...0000
+// TypeError: (455-472): Type int_const 1000...(1226 digits omitted)...0000 is not implicitly convertible to expected type int256.
+// TypeError: (486-503): Operator ** not compatible with types int_const -100...(1227 digits omitted)...0000 and int_const 1000...(1226 digits omitted)...0000
+// TypeError: (486-503): Type int_const -100...(1227 digits omitted)...0000 is not implicitly convertible to expected type int256.
+// TypeError: (517-535): Operator ** not compatible with types int_const -100...(1227 digits omitted)...0000 and int_const -100...(1227 digits omitted)...0000
+// TypeError: (517-535): Type int_const -100...(1227 digits omitted)...0000 is not implicitly convertible to expected type int256.
diff --git a/test/libsolidity/syntaxTests/types/rational_number_exp_limit_fine.sol b/test/libsolidity/syntaxTests/types/rational_number_exp_limit_fine.sol
new file mode 100644
index 00000000..66d02eb9
--- /dev/null
+++ b/test/libsolidity/syntaxTests/types/rational_number_exp_limit_fine.sol
@@ -0,0 +1,9 @@
+contract c {
+ function f() public pure {
+ int a;
+ a = 0 ** 1E1233;
+ a = 1 ** 1E1233;
+ a = -1 ** 1E1233;
+ a = 0E123456789;
+ }
+}
diff --git a/test/libsolidity/syntaxTests/types/var_type_suggest.sol b/test/libsolidity/syntaxTests/types/var_type_suggest.sol
new file mode 100644
index 00000000..176fab96
--- /dev/null
+++ b/test/libsolidity/syntaxTests/types/var_type_suggest.sol
@@ -0,0 +1,23 @@
+contract C {
+ function h() internal pure returns (uint, uint, uint) {
+ return (1, 2, 4);
+ }
+ function g(uint x) internal pure returns (uint) {
+ return x;
+ }
+ function f() internal pure {
+ var i = 31415;
+ var t = "string";
+ var g2 = g;
+ var myblockhash = block.blockhash;
+ var (a, b) = (2, "troi");
+ var (x,, z) = h();
+ }
+}
+// ----
+// SyntaxError: (224-237): Use of the "var" keyword is disallowed. Use explicit declaration `uint16 i = ...´ instead.
+// SyntaxError: (247-263): Use of the "var" keyword is disallowed. Use explicit declaration `string memory t = ...´ instead.
+// SyntaxError: (273-283): Use of the "var" keyword is disallowed. Use explicit declaration `function (uint256) pure returns (uint256) g2 = ...´ instead.
+// SyntaxError: (293-326): Use of the "var" keyword is disallowed. Type cannot be expressed in syntax.
+// SyntaxError: (336-360): Use of the "var" keyword is disallowed. Use explicit declaration `(uint8 a, string memory b) = ...´ instead.
+// SyntaxError: (370-387): Use of the "var" keyword is disallowed. Use explicit declaration `(uint256 x, , uint256 z) = ...´ instead.
diff --git a/test/libsolidity/syntaxTests/viewPure/view_pure_abi_encode.sol b/test/libsolidity/syntaxTests/viewPure/view_pure_abi_encode.sol
index ca7db42e..e0e031c2 100644
--- a/test/libsolidity/syntaxTests/viewPure/view_pure_abi_encode.sol
+++ b/test/libsolidity/syntaxTests/viewPure/view_pure_abi_encode.sol
@@ -1,5 +1,5 @@
contract C {
- function f() pure public returns (bytes r) {
+ function f() pure public returns (bytes memory r) {
r = abi.encode(1, 2);
r = abi.encodePacked(f());
r = abi.encodeWithSelector(0x12345678, 1);
diff --git a/test/libsolidity/syntaxTests/viewPure/view_pure_abi_encode_arguments.sol b/test/libsolidity/syntaxTests/viewPure/view_pure_abi_encode_arguments.sol
index 547362c3..cc845d51 100644
--- a/test/libsolidity/syntaxTests/viewPure/view_pure_abi_encode_arguments.sol
+++ b/test/libsolidity/syntaxTests/viewPure/view_pure_abi_encode_arguments.sol
@@ -3,34 +3,34 @@ contract C {
function gView() public view returns (uint) { return x; }
function gNonPayable() public returns (uint) { x = 4; return 0; }
- function f1() view public returns (bytes) {
+ function f1() view public returns (bytes memory) {
return abi.encode(gView());
}
- function f2() view public returns (bytes) {
+ function f2() view public returns (bytes memory) {
return abi.encodePacked(gView());
}
- function f3() view public returns (bytes) {
+ function f3() view public returns (bytes memory) {
return abi.encodeWithSelector(0x12345678, gView());
}
- function f4() view public returns (bytes) {
+ function f4() view public returns (bytes memory) {
return abi.encodeWithSignature("f(uint256)", gView());
}
- function g1() public returns (bytes) {
+ function g1() public returns (bytes memory) {
return abi.encode(gNonPayable());
}
- function g2() public returns (bytes) {
+ function g2() public returns (bytes memory) {
return abi.encodePacked(gNonPayable());
}
- function g3() public returns (bytes) {
+ function g3() public returns (bytes memory) {
return abi.encodeWithSelector(0x12345678, gNonPayable());
}
- function g4() public returns (bytes) {
+ function g4() public returns (bytes memory) {
return abi.encodeWithSignature("f(uint256)", gNonPayable());
}
// This will generate the only warning.
- function check() public returns (bytes) {
+ function check() public returns (bytes memory) {
return abi.encode(2);
}
}
// ----
-// Warning: (1044-1121): Function state mutability can be restricted to pure
+// Warning: (1100-1184): Function state mutability can be restricted to pure