From c175a468abffd9082bf0df96179c7502d7af6d96 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 11 Dec 2019 17:05:44 +0100 Subject: [PATCH] Do not call ABIEncoderV2 experimental. --- docs/layout-of-source-files.rst | 10 ++++++---- docs/using-the-compiler.rst | 1 - libsolidity/analysis/ContractLevelChecker.cpp | 4 ++-- libsolidity/analysis/TypeChecker.cpp | 6 +++--- .../syntaxTests/array/calldata_multi_dynamic_V1.sol | 4 ++-- .../syntaxTests/events/event_nested_array.sol | 2 +- .../events/event_nested_array_in_struct.sol | 2 +- test/libsolidity/syntaxTests/events/event_struct.sol | 2 +- .../syntaxTests/events/event_struct_indexed.sol | 2 +- test/libsolidity/syntaxTests/getter/nested_structs.sol | 2 +- .../imports/inheritance_abi_encoder_mismatch_1.sol | 2 +- .../imports/inheritance_abi_encoder_mismatch_2.sol | 2 +- .../045_returning_multi_dimensional_arrays.sol | 2 +- .../046_returning_multi_dimensional_static_arrays.sol | 2 +- .../048_returning_arrays_in_structs_arrays.sol | 2 +- 15 files changed, 23 insertions(+), 22 deletions(-) diff --git a/docs/layout-of-source-files.rst b/docs/layout-of-source-files.rst index 31e89b1e5..411d27b6b 100644 --- a/docs/layout-of-source-files.rst +++ b/docs/layout-of-source-files.rst @@ -70,10 +70,12 @@ ABIEncoderV2 ~~~~~~~~~~~~ The new ABI encoder is able to encode and decode arbitrarily nested -arrays and structs. It produces less optimal code (the optimizer -for this part of the code is still under development) and has not -received as much testing as the old encoder. You can activate it -using ``pragma experimental ABIEncoderV2;``. +arrays and structs. It might produce less optimal code and has not +received as much testing as the old encoder, but is considered +non-experimental as of Solidity 0.6.0. You still have to explicitly +activate it using ``pragma experimental ABIEncoderV2;`` - we kept +the same pragma, even though it is not considered experimental +anymore. .. _smt_checker: diff --git a/docs/using-the-compiler.rst b/docs/using-the-compiler.rst index 439a6432c..9921c1c1b 100644 --- a/docs/using-the-compiler.rst +++ b/docs/using-the-compiler.rst @@ -222,7 +222,6 @@ Input Description "constantOptimizer": false, // The new Yul optimizer. Mostly operates on the code of ABIEncoderV2. // It can only be activated through the details here. - // This feature is still considered experimental. "yul": false, // Tuning options for the Yul optimizer. "yulDetails": { diff --git a/libsolidity/analysis/ContractLevelChecker.cpp b/libsolidity/analysis/ContractLevelChecker.cpp index 687511c53..069bd4d94 100644 --- a/libsolidity/analysis/ContractLevelChecker.cpp +++ b/libsolidity/analysis/ContractLevelChecker.cpp @@ -416,7 +416,7 @@ void ContractLevelChecker::checkBaseABICompatibility(ContractDefinition const& _ for (TypePointer const& paramType: func.second->parameterTypes() + func.second->parameterTypes()) if (!TypeChecker::typeSupportedByOldABIEncoder(*paramType, false)) { - errors.append("Type only supported by the new experimental ABI encoder", currentLoc); + errors.append("Type only supported by ABIEncoderV2", currentLoc); break; } } @@ -427,7 +427,7 @@ void ContractLevelChecker::checkBaseABICompatibility(ContractDefinition const& _ errors, std::string("Contract \"") + _contract.name() + - "\" does not use the new experimental ABI encoder but wants to inherit from a contract " + + "\" does not use ABIEncoderV2 but wants to inherit from a contract " + "which uses types that require it. " + "Use \"pragma experimental ABIEncoderV2;\" for the inheriting contract as well to enable the feature." ); diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 43642de3c..26f473ee1 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -380,7 +380,7 @@ bool TypeChecker::visit(FunctionDefinition const& _function) ) m_errorReporter.typeError( var.location(), - "This type is only supported in the new experimental ABI encoder. " + "This type is only supported in ABIEncoderV2. " "Use \"pragma experimental ABIEncoderV2;\" to enable the feature." ); }; @@ -509,7 +509,7 @@ bool TypeChecker::visit(VariableDeclaration const& _variable) unsupportedTypes.emplace_back(param->toString()); if (!unsupportedTypes.empty()) m_errorReporter.typeError(_variable.location(), - "The following types are only supported for getters in the new experimental ABI encoder: " + + "The following types are only supported for getters in ABIEncoderV2: " + joinHumanReadable(unsupportedTypes) + ". Either remove \"public\" or use \"pragma experimental ABIEncoderV2;\" to enable the feature." ); @@ -620,7 +620,7 @@ bool TypeChecker::visit(EventDefinition const& _eventDef) ) m_errorReporter.typeError( var->location(), - "This type is only supported in the new experimental ABI encoder. " + "This type is only supported in ABIEncoderV2. " "Use \"pragma experimental ABIEncoderV2;\" to enable the feature." ); } diff --git a/test/libsolidity/syntaxTests/array/calldata_multi_dynamic_V1.sol b/test/libsolidity/syntaxTests/array/calldata_multi_dynamic_V1.sol index 0ee5135a6..7f5cb6aa7 100644 --- a/test/libsolidity/syntaxTests/array/calldata_multi_dynamic_V1.sol +++ b/test/libsolidity/syntaxTests/array/calldata_multi_dynamic_V1.sol @@ -3,5 +3,5 @@ contract Test { function g(uint[][1] calldata) external { } } // ---- -// TypeError: (31-48): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature. -// TypeError: (78-96): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature. +// TypeError: (31-48): This type is only supported in ABIEncoderV2. Use "pragma experimental ABIEncoderV2;" to enable the feature. +// TypeError: (78-96): This type is only supported in ABIEncoderV2. Use "pragma experimental ABIEncoderV2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/events/event_nested_array.sol b/test/libsolidity/syntaxTests/events/event_nested_array.sol index 70af63b69..ca92224e4 100644 --- a/test/libsolidity/syntaxTests/events/event_nested_array.sol +++ b/test/libsolidity/syntaxTests/events/event_nested_array.sol @@ -2,4 +2,4 @@ contract c { event E(uint[][]); } // ---- -// TypeError: (25-33): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature. +// TypeError: (25-33): This type is only supported in ABIEncoderV2. Use "pragma experimental ABIEncoderV2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/events/event_nested_array_in_struct.sol b/test/libsolidity/syntaxTests/events/event_nested_array_in_struct.sol index fd59e9624..06739699d 100644 --- a/test/libsolidity/syntaxTests/events/event_nested_array_in_struct.sol +++ b/test/libsolidity/syntaxTests/events/event_nested_array_in_struct.sol @@ -3,4 +3,4 @@ contract c { event E(S); } // ---- -// TypeError: (61-62): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature. +// TypeError: (61-62): This type is only supported in ABIEncoderV2. Use "pragma experimental ABIEncoderV2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/events/event_struct.sol b/test/libsolidity/syntaxTests/events/event_struct.sol index c955dc5eb..99b4718c6 100644 --- a/test/libsolidity/syntaxTests/events/event_struct.sol +++ b/test/libsolidity/syntaxTests/events/event_struct.sol @@ -3,4 +3,4 @@ contract c { event E(S); } // ---- -// TypeError: (51-52): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature. +// TypeError: (51-52): This type is only supported in ABIEncoderV2. Use "pragma experimental ABIEncoderV2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/events/event_struct_indexed.sol b/test/libsolidity/syntaxTests/events/event_struct_indexed.sol index 7332cb3b1..169b74e85 100644 --- a/test/libsolidity/syntaxTests/events/event_struct_indexed.sol +++ b/test/libsolidity/syntaxTests/events/event_struct_indexed.sol @@ -3,4 +3,4 @@ contract c { event E(S indexed); } // ---- -// TypeError: (51-60): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature. +// TypeError: (51-60): This type is only supported in ABIEncoderV2. Use "pragma experimental ABIEncoderV2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/getter/nested_structs.sol b/test/libsolidity/syntaxTests/getter/nested_structs.sol index 1068f2871..f33bf53e1 100644 --- a/test/libsolidity/syntaxTests/getter/nested_structs.sol +++ b/test/libsolidity/syntaxTests/getter/nested_structs.sol @@ -8,4 +8,4 @@ contract C { mapping(uint256 => X) public m; } // ---- -// TypeError: (88-118): The following types are only supported for getters in the new experimental ABI encoder: struct C.Y memory. Either remove "public" or use "pragma experimental ABIEncoderV2;" to enable the feature. +// TypeError: (88-118): The following types are only supported for getters in ABIEncoderV2: struct C.Y memory. Either remove "public" or use "pragma experimental ABIEncoderV2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_1.sol b/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_1.sol index e7602d826..5cced4a1a 100644 --- a/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_1.sol +++ b/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_1.sol @@ -16,4 +16,4 @@ contract B is A { } import "./B.sol"; contract C is B { } // ---- -// TypeError: (C.sol:18-37): Contract "C" does not use the new experimental ABI encoder but wants to inherit from a contract which uses types that require it. Use "pragma experimental ABIEncoderV2;" for the inheriting contract as well to enable the feature. +// TypeError: (C.sol:18-37): Contract "C" does not use ABIEncoderV2 but wants to inherit from a contract which uses types that require it. Use "pragma experimental ABIEncoderV2;" for the inheriting contract as well to enable the feature. diff --git a/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_2.sol b/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_2.sol index 983b6dc11..b8bddff66 100644 --- a/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_2.sol +++ b/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_2.sol @@ -14,4 +14,4 @@ contract B is A { } import "./B.sol"; contract C is B { } // ---- -// TypeError: (B.sol:18-37): Contract "B" does not use the new experimental ABI encoder but wants to inherit from a contract which uses types that require it. Use "pragma experimental ABIEncoderV2;" for the inheriting contract as well to enable the feature. +// TypeError: (B.sol:18-37): Contract "B" does not use ABIEncoderV2 but wants to inherit from a contract which uses types that require it. Use "pragma experimental ABIEncoderV2;" for the inheriting contract as well to enable the feature. 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 b9a64c2a2..975d2f006 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/045_returning_multi_dimensional_arrays.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/045_returning_multi_dimensional_arrays.sol @@ -2,4 +2,4 @@ contract C { function f() public pure returns (string[][] memory) {} } // ---- -// TypeError: (51-68): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature. +// TypeError: (51-68): This type is only supported in ABIEncoderV2. 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 ccee60934..8df1f9e7b 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 @@ -2,4 +2,4 @@ contract C { function f() public pure returns (uint[][2] memory) {} } // ---- -// TypeError: (51-67): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature. +// TypeError: (51-67): This type is only supported in ABIEncoderV2. Use "pragma experimental ABIEncoderV2;" to enable the feature. 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 48e80fcf2..4267c62e9 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 @@ -3,4 +3,4 @@ contract C { function f() public pure returns (S memory x) {} } // ---- -// TypeError: (80-90): 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 ABIEncoderV2. Use "pragma experimental ABIEncoderV2;" to enable the feature.