mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Also check the object type for bound functions.
This commit is contained in:
@@ -127,9 +127,9 @@ void UsingForDirective::accept(ASTVisitor& _visitor)
|
||||
{
|
||||
if (_visitor.visit(*this))
|
||||
{
|
||||
if (m_libraryName)
|
||||
m_libraryName->accept(_visitor);
|
||||
m_typeName->accept(_visitor);
|
||||
m_libraryName->accept(_visitor);
|
||||
if (m_typeName)
|
||||
m_typeName->accept(_visitor);
|
||||
}
|
||||
_visitor.endVisit(*this);
|
||||
}
|
||||
@@ -138,9 +138,9 @@ void UsingForDirective::accept(ASTConstVisitor& _visitor) const
|
||||
{
|
||||
if (_visitor.visit(*this))
|
||||
{
|
||||
if (m_libraryName)
|
||||
m_libraryName->accept(_visitor);
|
||||
m_typeName->accept(_visitor);
|
||||
m_libraryName->accept(_visitor);
|
||||
if (m_typeName)
|
||||
m_typeName->accept(_visitor);
|
||||
}
|
||||
_visitor.endVisit(*this);
|
||||
}
|
||||
|
||||
@@ -1640,8 +1640,11 @@ MemberList::MemberMap FunctionType::nativeMembers(ContractDefinition const*) con
|
||||
}
|
||||
}
|
||||
|
||||
bool FunctionType::canTakeArguments(TypePointers const& _argumentTypes) const
|
||||
bool FunctionType::canTakeArguments(TypePointers const& _argumentTypes, TypePointer const& _selfType) const
|
||||
{
|
||||
solAssert(!bound() || _selfType, "");
|
||||
if (bound() && !_selfType->isImplicitlyConvertibleTo(*selfType()))
|
||||
return false;
|
||||
TypePointers paramTypes = parameterTypes();
|
||||
if (takesArbitraryParameters())
|
||||
return true;
|
||||
|
||||
@@ -829,7 +829,9 @@ public:
|
||||
|
||||
/// @returns true if this function can take the given argument types (possibly
|
||||
/// after implicit conversion).
|
||||
bool canTakeArguments(TypePointers const& _arguments) const;
|
||||
/// @param _selfType if the function is bound, this has to be supplied and is the type of the
|
||||
/// expression the function is called on.
|
||||
bool canTakeArguments(TypePointers const& _arguments, TypePointer const& _selfType = TypePointer()) const;
|
||||
/// @returns true if the types of parameters are equal (does't check return parameter types)
|
||||
bool hasEqualArgumentTypes(FunctionType const& _other) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user