Merge pull request #8865 from a3d4/fix-8712-abi-compiler-error

Fix ABI internal compiler error caused by an internal constructor
This commit is contained in:
chriseth 2020-05-07 10:55:00 +02:00 committed by GitHub
commit 80b4e51fd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -9,6 +9,7 @@ Compiler Features:
Bugfixes:
* ABI: Skip ``private`` or ``internal`` constructors.

View File

@ -73,9 +73,10 @@ Json::Value ABI::generate(ContractDefinition const& _contractDef)
);
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();
solAssert(!!externalFunctionType, "");
Json::Value method;

View File

@ -0,0 +1,9 @@
// bug #8712
contract B {
uint immutable x;
constructor(function() internal returns(uint) fp) internal {
x = fp(); }
}
// ----
// :B
// []