mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #5994 from ethereum/error-to-assert
Turn unreachable error into assert
This commit is contained in:
commit
f003696d7e
@ -2090,9 +2090,8 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
|
|||||||
annotation.type = possibleMembers.front().type;
|
annotation.type = possibleMembers.front().type;
|
||||||
|
|
||||||
if (auto funType = dynamic_cast<FunctionType const*>(annotation.type.get()))
|
if (auto funType = dynamic_cast<FunctionType const*>(annotation.type.get()))
|
||||||
if (funType->bound() && !exprType->isImplicitlyConvertibleTo(*funType->selfType()))
|
solAssert(
|
||||||
m_errorReporter.typeError(
|
!funType->bound() || exprType->isImplicitlyConvertibleTo(*funType->selfType()),
|
||||||
_memberAccess.location(),
|
|
||||||
"Function \"" + memberName + "\" cannot be called on an object of type " +
|
"Function \"" + memberName + "\" cannot be called on an object of type " +
|
||||||
exprType->toString() + " (expected " + funType->selfType()->toString() + ")."
|
exprType->toString() + " (expected " + funType->selfType()->toString() + ")."
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user