mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
TypeChecker: Use cast instead of category() check
This commit is contained in:
parent
10a9960eb3
commit
223dac3eca
@ -2051,18 +2051,15 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
|
||||
errorMsg.pop_back();
|
||||
errorMsg += " - did you forget the \"payable\" modifier?";
|
||||
}
|
||||
else if (exprType->category() == Type::Category::Function)
|
||||
else if (auto const& funType = dynamic_pointer_cast<FunctionType const>(exprType))
|
||||
{
|
||||
if (auto const& funType = dynamic_pointer_cast<FunctionType const>(exprType))
|
||||
{
|
||||
auto const& t = funType->returnParameterTypes();
|
||||
if (t.size() == 1)
|
||||
if (
|
||||
t.front()->category() == Type::Category::Contract ||
|
||||
t.front()->category() == Type::Category::Struct
|
||||
)
|
||||
errorMsg += " Did you intend to call the function?";
|
||||
}
|
||||
auto const& t = funType->returnParameterTypes();
|
||||
if (t.size() == 1)
|
||||
if (
|
||||
t.front()->category() == Type::Category::Contract ||
|
||||
t.front()->category() == Type::Category::Struct
|
||||
)
|
||||
errorMsg += " Did you intend to call the function?";
|
||||
}
|
||||
else if (exprType->category() == Type::Category::Contract)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user