mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow constructor in interfaces
This commit is contained in:
@@ -463,6 +463,9 @@ bool TypeChecker::visit(FunctionDefinition const& _function)
|
||||
typeError(_function.location(), "Functions in interfaces cannot have an implementation.");
|
||||
_function.body().accept(*this);
|
||||
}
|
||||
if (_function.isConstructor())
|
||||
if (m_scope->contractKind() == ContractDefinition::ContractKind::Interface)
|
||||
typeError(_function.location(), "Constructor cannot be defined in interfaces.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user