mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow use of virtual and private together
This commit is contained in:
@@ -327,8 +327,13 @@ bool TypeChecker::visit(FunctionDefinition const& _function)
|
||||
{
|
||||
bool isLibraryFunction = _function.inContractKind() == ContractDefinition::ContractKind::Library;
|
||||
|
||||
if (_function.markedVirtual() && _function.annotation().contract->isInterface())
|
||||
m_errorReporter.warning(_function.location(), "Interface functions are implicitly \"virtual\"");
|
||||
if (_function.markedVirtual())
|
||||
{
|
||||
if (_function.annotation().contract->isInterface())
|
||||
m_errorReporter.warning(_function.location(), "Interface functions are implicitly \"virtual\"");
|
||||
if (_function.visibility() == Declaration::Visibility::Private)
|
||||
m_errorReporter.typeError(_function.location(), "\"virtual\" and \"private\" cannot be used together.");
|
||||
}
|
||||
|
||||
if (_function.isPayable())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user