mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Prohibit interfaces inheriting from non-interfaces
This commit is contained in:
@@ -237,6 +237,9 @@ void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance)
|
||||
auto base = dynamic_cast<ContractDefinition const*>(&dereference(_inheritance.name()));
|
||||
solAssert(base, "Base contract not available.");
|
||||
|
||||
if (m_scope->isInterface() && !base->isInterface())
|
||||
m_errorReporter.typeError(_inheritance.location(), "Interfaces can only inherit from other interfaces.");
|
||||
|
||||
if (base->isLibrary())
|
||||
m_errorReporter.typeError(_inheritance.location(), "Libraries cannot be inherited from.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user