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
3 changed files with 13 additions and 2 deletions
+1
View File
@@ -9,6 +9,7 @@ Compiler Features:
Bugfixes:
* ABI: Skip ``private`` or ``internal`` constructors.
+3 -2
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;
@@ -0,0 +1,9 @@
// bug #8712
contract B {
uint immutable x;
constructor(function() internal returns(uint) fp) internal {
x = fp(); }
}
// ----
// :B
// []