mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2887 from ethereum/missing-functions-list
Show each unimplemented function in secondary source location
This commit is contained in:
commit
ac3742cd25
@ -458,7 +458,7 @@ void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance)
|
|||||||
" to " +
|
" to " +
|
||||||
parameterTypes[i]->toString() +
|
parameterTypes[i]->toString() +
|
||||||
" requested."
|
" requested."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeChecker::endVisit(UsingForDirective const& _usingFor)
|
void TypeChecker::endVisit(UsingForDirective const& _usingFor)
|
||||||
@ -1583,14 +1583,16 @@ void TypeChecker::endVisit(NewExpression const& _newExpression)
|
|||||||
if (contract->contractKind() == ContractDefinition::ContractKind::Interface)
|
if (contract->contractKind() == ContractDefinition::ContractKind::Interface)
|
||||||
m_errorReporter.fatalTypeError(_newExpression.location(), "Cannot instantiate an interface.");
|
m_errorReporter.fatalTypeError(_newExpression.location(), "Cannot instantiate an interface.");
|
||||||
if (!contract->annotation().unimplementedFunctions.empty())
|
if (!contract->annotation().unimplementedFunctions.empty())
|
||||||
|
{
|
||||||
|
SecondarySourceLocation ssl;
|
||||||
|
for (auto function: contract->annotation().unimplementedFunctions)
|
||||||
|
ssl.append("Missing implementation:", function->location());
|
||||||
m_errorReporter.typeError(
|
m_errorReporter.typeError(
|
||||||
_newExpression.location(),
|
_newExpression.location(),
|
||||||
SecondarySourceLocation().append(
|
ssl,
|
||||||
"Missing implementation:",
|
|
||||||
contract->annotation().unimplementedFunctions.front()->location()
|
|
||||||
),
|
|
||||||
"Trying to create an instance of an abstract contract."
|
"Trying to create an instance of an abstract contract."
|
||||||
);
|
);
|
||||||
|
}
|
||||||
if (!contract->constructorIsPublic())
|
if (!contract->constructorIsPublic())
|
||||||
m_errorReporter.typeError(_newExpression.location(), "Contract with internal constructor cannot be created directly.");
|
m_errorReporter.typeError(_newExpression.location(), "Contract with internal constructor cannot be created directly.");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user