Fixes ICE when overriding an implemented modifier with an unimplemented one.

This commit is contained in:
Christian Parpart
2021-06-09 13:15:20 +02:00
parent 8de575f738
commit a14ac1923d
7 changed files with 63 additions and 8 deletions
+13 -8
View File
@@ -573,6 +573,19 @@ void OverrideChecker::checkOverride(OverrideProxy const& _overriding, OverridePr
);
}
if (_overriding.unimplemented() && !_super.unimplemented())
{
solAssert(!_overriding.isVariable() || !_overriding.unimplemented(), "");
overrideError(
_overriding,
_super,
4593_error,
"Overriding an implemented " + _super.astNodeName() +
" with an unimplemented " + _overriding.astNodeName() +
" is not allowed."
);
}
if (_super.isFunction())
{
FunctionType const* functionType = _overriding.functionType();
@@ -613,14 +626,6 @@ void OverrideChecker::checkOverride(OverrideProxy const& _overriding, OverridePr
stateMutabilityToString(_overriding.stateMutability()) +
"\"."
);
if (_overriding.unimplemented() && !_super.unimplemented())
overrideError(
_overriding,
_super,
4593_error,
"Overriding an implemented function with an unimplemented function is not allowed."
);
}
}