mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move public constructor property into AST itself.
This commit is contained in:
@@ -132,6 +132,12 @@ FunctionDefinition const* ContractDefinition::constructor() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool ContractDefinition::constructorIsPublic() const
|
||||
{
|
||||
FunctionDefinition const* f = constructor();
|
||||
return !f || f->isPublic();
|
||||
}
|
||||
|
||||
FunctionDefinition const* ContractDefinition::fallbackFunction() const
|
||||
{
|
||||
for (ContractDefinition const* contract: annotation().linearizedBaseContracts)
|
||||
|
||||
@@ -356,6 +356,8 @@ public:
|
||||
|
||||
/// Returns the constructor or nullptr if no constructor was specified.
|
||||
FunctionDefinition const* constructor() const;
|
||||
/// @returns true iff the constructor of this contract is public (or non-existing).
|
||||
bool constructorIsPublic() const;
|
||||
/// Returns the fallback function or nullptr if no fallback function was specified.
|
||||
FunctionDefinition const* fallbackFunction() const;
|
||||
|
||||
|
||||
@@ -80,8 +80,6 @@ struct ContractDefinitionAnnotation: TypeDeclarationAnnotation, DocumentedAnnota
|
||||
{
|
||||
/// Whether all functions are implemented.
|
||||
bool isFullyImplemented = true;
|
||||
/// Whether a public constructor (even the default one) is available.
|
||||
bool hasPublicConstructor = true;
|
||||
/// List of all (direct and indirect) base contracts in order from derived to
|
||||
/// base, including the contract itself.
|
||||
std::vector<ContractDefinition const*> linearizedBaseContracts;
|
||||
|
||||
Reference in New Issue
Block a user