Relax delegatecall type restriction plus test

This commit is contained in:
Nikola Matic
2023-07-18 17:07:13 +02:00
parent 110e2a656d
commit 82cb5338a9
3 changed files with 17 additions and 6 deletions
+3 -5
View File
@@ -3423,12 +3423,10 @@ MemberList::MemberMap FunctionType::nativeMembers(ASTNode const* _scope) const
}
case Kind::DelegateCall:
{
auto const* functionDefinition = dynamic_cast<FunctionDefinition const*>(m_declaration);
solAssert(functionDefinition, "");
solAssert(functionDefinition->visibility() != Visibility::Private, "");
if (functionDefinition->visibility() != Visibility::Internal)
if (auto const* functionDefinition = dynamic_cast<FunctionDefinition const*>(m_declaration))
{
auto const* contract = dynamic_cast<ContractDefinition const*>(m_declaration->scope());
solAssert(functionDefinition->visibility() > Visibility::Internal, "");
auto const *contract = dynamic_cast<ContractDefinition const*>(m_declaration->scope());
solAssert(contract, "");
solAssert(contract->isLibrary(), "");
return {{"selector", TypeProvider::fixedBytes(4)}};