mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix ABI internal compiler error caused by an internal constructor
This commit is contained in:
parent
5e46ef7df5
commit
5e9502bfae
@ -9,6 +9,7 @@ Compiler Features:
|
|||||||
|
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
* ABI: Skip ``private`` or ``internal`` constructors.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,9 +73,10 @@ Json::Value ABI::generate(ContractDefinition const& _contractDef)
|
|||||||
);
|
);
|
||||||
abi.emplace(std::move(method));
|
abi.emplace(std::move(method));
|
||||||
}
|
}
|
||||||
if (_contractDef.constructor())
|
FunctionDefinition const* constructor = _contractDef.constructor();
|
||||||
|
if (constructor && constructor->visibility() >= Visibility::Public)
|
||||||
{
|
{
|
||||||
FunctionType constrType(*_contractDef.constructor());
|
FunctionType constrType(*constructor);
|
||||||
FunctionType const* externalFunctionType = constrType.interfaceFunctionType();
|
FunctionType const* externalFunctionType = constrType.interfaceFunctionType();
|
||||||
solAssert(!!externalFunctionType, "");
|
solAssert(!!externalFunctionType, "");
|
||||||
Json::Value method;
|
Json::Value method;
|
||||||
|
9
test/libsolidity/ABIJson/internal_constructor.sol
Normal file
9
test/libsolidity/ABIJson/internal_constructor.sol
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// bug #8712
|
||||||
|
contract B {
|
||||||
|
uint immutable x;
|
||||||
|
constructor(function() internal returns(uint) fp) internal {
|
||||||
|
x = fp(); }
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// :B
|
||||||
|
// []
|
Loading…
Reference in New Issue
Block a user