Minor fixes after code review

This commit is contained in:
wechman 2022-09-01 10:06:41 +02:00
parent c507d24a78
commit 1a8564545e
2 changed files with 4 additions and 5 deletions

View File

@ -29,7 +29,6 @@
#include <stack>
#include <utility>
#include <vector>
#include <variant>
namespace solidity::frontend
{

View File

@ -452,15 +452,15 @@ MemberList::MemberMap Type::boundFunctions(Type const& _type, ASTNode const& _sc
};
for (UsingForDirective const* ufd: usingForDirectivesForType(_type, _scope))
for (auto const& [pathPointer, operator_]: ufd->functionsAndOperators())
for (auto const& [identifierPath, operator_]: ufd->functionsAndOperators())
{
if (operator_.has_value())
// Functions used to define operators are not bound to the type.
// I.e. `using {f} for T` allows `T x; x.f()` but `using {f as +} for T` does not.
continue;
solAssert(pathPointer);
Declaration const* declaration = pathPointer->annotation().referencedDeclaration;
solAssert(identifierPath);
Declaration const* declaration = identifierPath->annotation().referencedDeclaration;
solAssert(declaration);
if (ContractDefinition const* library = dynamic_cast<ContractDefinition const*>(declaration))
@ -476,7 +476,7 @@ MemberList::MemberMap Type::boundFunctions(Type const& _type, ASTNode const& _sc
else
addFunction(
dynamic_cast<FunctionDefinition const&>(*declaration),
pathPointer->path().back()
identifierPath->path().back()
);
}