mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Replace inContractKind by libraryFunction.
This commit is contained in:
@@ -287,11 +287,11 @@ TypeDeclarationAnnotation& EnumDefinition::annotation() const
|
||||
return initAnnotation<TypeDeclarationAnnotation>();
|
||||
}
|
||||
|
||||
ContractKind FunctionDefinition::inContractKind() const
|
||||
bool FunctionDefinition::libraryFunction() const
|
||||
{
|
||||
auto contractDef = dynamic_cast<ContractDefinition const*>(scope());
|
||||
solAssert(contractDef, "Enclosing Scope of FunctionDefinition was not set.");
|
||||
return contractDef->contractKind();
|
||||
if (auto const* contractDef = dynamic_cast<ContractDefinition const*>(scope()))
|
||||
return contractDef->isLibrary();
|
||||
return false;
|
||||
}
|
||||
|
||||
FunctionTypePointer FunctionDefinition::functionType(bool _internal) const
|
||||
|
||||
@@ -799,6 +799,7 @@ public:
|
||||
void accept(ASTConstVisitor& _visitor) const override;
|
||||
|
||||
StateMutability stateMutability() const { return m_stateMutability; }
|
||||
bool libraryFunction() const;
|
||||
bool isOrdinary() const { return m_kind == Token::Function; }
|
||||
bool isConstructor() const { return m_kind == Token::Constructor; }
|
||||
bool isFallback() const { return m_kind == Token::Fallback; }
|
||||
@@ -825,8 +826,6 @@ public:
|
||||
/// @returns the external identifier of this function (the hash of the signature) as a hex string.
|
||||
std::string externalIdentifierHex() const;
|
||||
|
||||
ContractKind inContractKind() const;
|
||||
|
||||
TypePointer type() const override;
|
||||
TypePointer typeViaContractName() const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user