mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Simplify DeclarationRegistrationHelper
This commit is contained in:
+18
-5
@@ -495,6 +495,24 @@ string Scopable::sourceUnitName() const
|
||||
return *sourceUnit().annotation().path;
|
||||
}
|
||||
|
||||
bool Declaration::isEnumValue() const
|
||||
{
|
||||
solAssert(scope(), "");
|
||||
return dynamic_cast<EnumDefinition const*>(scope());
|
||||
}
|
||||
|
||||
bool Declaration::isStructMember() const
|
||||
{
|
||||
solAssert(scope(), "");
|
||||
return dynamic_cast<StructDefinition const*>(scope());
|
||||
}
|
||||
|
||||
bool Declaration::isEventParameter() const
|
||||
{
|
||||
solAssert(scope(), "");
|
||||
return dynamic_cast<EventDefinition const*>(scope());
|
||||
}
|
||||
|
||||
DeclarationAnnotation& Declaration::annotation() const
|
||||
{
|
||||
return initAnnotation<DeclarationAnnotation>();
|
||||
@@ -617,11 +635,6 @@ bool VariableDeclaration::isLibraryFunctionParameter() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VariableDeclaration::isEventParameter() const
|
||||
{
|
||||
return dynamic_cast<EventDefinition const*>(scope()) != nullptr;
|
||||
}
|
||||
|
||||
bool VariableDeclaration::hasReferenceOrMappingType() const
|
||||
{
|
||||
solAssert(typeName().annotation().type, "Can only be called after reference resolution");
|
||||
|
||||
Reference in New Issue
Block a user