mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Do not call ABIEncoderV2 experimental.
This commit is contained in:
parent
b9c35916e5
commit
c175a468ab
@ -70,10 +70,12 @@ ABIEncoderV2
|
|||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
The new ABI encoder is able to encode and decode arbitrarily nested
|
The new ABI encoder is able to encode and decode arbitrarily nested
|
||||||
arrays and structs. It produces less optimal code (the optimizer
|
arrays and structs. It might produce less optimal code and has not
|
||||||
for this part of the code is still under development) and has not
|
received as much testing as the old encoder, but is considered
|
||||||
received as much testing as the old encoder. You can activate it
|
non-experimental as of Solidity 0.6.0. You still have to explicitly
|
||||||
using ``pragma experimental ABIEncoderV2;``.
|
activate it using ``pragma experimental ABIEncoderV2;`` - we kept
|
||||||
|
the same pragma, even though it is not considered experimental
|
||||||
|
anymore.
|
||||||
|
|
||||||
.. _smt_checker:
|
.. _smt_checker:
|
||||||
|
|
||||||
|
@ -222,7 +222,6 @@ Input Description
|
|||||||
"constantOptimizer": false,
|
"constantOptimizer": false,
|
||||||
// The new Yul optimizer. Mostly operates on the code of ABIEncoderV2.
|
// The new Yul optimizer. Mostly operates on the code of ABIEncoderV2.
|
||||||
// It can only be activated through the details here.
|
// It can only be activated through the details here.
|
||||||
// This feature is still considered experimental.
|
|
||||||
"yul": false,
|
"yul": false,
|
||||||
// Tuning options for the Yul optimizer.
|
// Tuning options for the Yul optimizer.
|
||||||
"yulDetails": {
|
"yulDetails": {
|
||||||
|
@ -416,7 +416,7 @@ void ContractLevelChecker::checkBaseABICompatibility(ContractDefinition const& _
|
|||||||
for (TypePointer const& paramType: func.second->parameterTypes() + func.second->parameterTypes())
|
for (TypePointer const& paramType: func.second->parameterTypes() + func.second->parameterTypes())
|
||||||
if (!TypeChecker::typeSupportedByOldABIEncoder(*paramType, false))
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -427,7 +427,7 @@ void ContractLevelChecker::checkBaseABICompatibility(ContractDefinition const& _
|
|||||||
errors,
|
errors,
|
||||||
std::string("Contract \"") +
|
std::string("Contract \"") +
|
||||||
_contract.name() +
|
_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. " +
|
"which uses types that require it. " +
|
||||||
"Use \"pragma experimental ABIEncoderV2;\" for the inheriting contract as well to enable the feature."
|
"Use \"pragma experimental ABIEncoderV2;\" for the inheriting contract as well to enable the feature."
|
||||||
);
|
);
|
||||||
|
@ -380,7 +380,7 @@ bool TypeChecker::visit(FunctionDefinition const& _function)
|
|||||||
)
|
)
|
||||||
m_errorReporter.typeError(
|
m_errorReporter.typeError(
|
||||||
var.location(),
|
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."
|
"Use \"pragma experimental ABIEncoderV2;\" to enable the feature."
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -509,7 +509,7 @@ bool TypeChecker::visit(VariableDeclaration const& _variable)
|
|||||||
unsupportedTypes.emplace_back(param->toString());
|
unsupportedTypes.emplace_back(param->toString());
|
||||||
if (!unsupportedTypes.empty())
|
if (!unsupportedTypes.empty())
|
||||||
m_errorReporter.typeError(_variable.location(),
|
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) +
|
joinHumanReadable(unsupportedTypes) +
|
||||||
". Either remove \"public\" or use \"pragma experimental ABIEncoderV2;\" to enable the feature."
|
". 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(
|
m_errorReporter.typeError(
|
||||||
var->location(),
|
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."
|
"Use \"pragma experimental ABIEncoderV2;\" to enable the feature."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,5 @@ contract Test {
|
|||||||
function g(uint[][1] calldata) external { }
|
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: (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 the new experimental ABI encoder. 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.
|
||||||
|
@ -2,4 +2,4 @@ contract c {
|
|||||||
event E(uint[][]);
|
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.
|
||||||
|
@ -3,4 +3,4 @@ contract c {
|
|||||||
event E(S);
|
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.
|
||||||
|
@ -3,4 +3,4 @@ contract c {
|
|||||||
event E(S);
|
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.
|
||||||
|
@ -3,4 +3,4 @@ contract c {
|
|||||||
event E(S indexed);
|
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.
|
||||||
|
@ -8,4 +8,4 @@ contract C {
|
|||||||
mapping(uint256 => X) public m;
|
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.
|
||||||
|
@ -16,4 +16,4 @@ contract B is A { }
|
|||||||
import "./B.sol";
|
import "./B.sol";
|
||||||
contract C is B { }
|
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.
|
||||||
|
@ -14,4 +14,4 @@ contract B is A { }
|
|||||||
import "./B.sol";
|
import "./B.sol";
|
||||||
contract C is B { }
|
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.
|
||||||
|
@ -2,4 +2,4 @@ contract C {
|
|||||||
function f() public pure returns (string[][] memory) {}
|
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.
|
||||||
|
@ -2,4 +2,4 @@ contract C {
|
|||||||
function f() public pure returns (uint[][2] memory) {}
|
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.
|
||||||
|
@ -3,4 +3,4 @@ contract C {
|
|||||||
function f() public pure returns (S memory x) {}
|
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.
|
||||||
|
Loading…
Reference in New Issue
Block a user