mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Turn unreachable error into assert
The exact conditions are already checked when iterating over the possibleMembers where the function `canTakeArguments()` is called for each member. The function does the identical check.
This commit is contained in:
parent
10888b21d8
commit
a70fee7316
@ -2090,9 +2090,8 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
|
||||
annotation.type = possibleMembers.front().type;
|
||||
|
||||
if (auto funType = dynamic_cast<FunctionType const*>(annotation.type.get()))
|
||||
if (funType->bound() && !exprType->isImplicitlyConvertibleTo(*funType->selfType()))
|
||||
m_errorReporter.typeError(
|
||||
_memberAccess.location(),
|
||||
solAssert(
|
||||
!funType->bound() || exprType->isImplicitlyConvertibleTo(*funType->selfType()),
|
||||
"Function \"" + memberName + "\" cannot be called on an object of type " +
|
||||
exprType->toString() + " (expected " + funType->selfType()->toString() + ")."
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user