mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Avoid duplicate errors due to function overrides
This commit is contained in:
parent
d4997dd9a3
commit
3571db6e3f
@ -308,19 +308,19 @@ void TypeChecker::checkFunctionOverride(FunctionDefinition const& function, Func
|
|||||||
if (function.visibility() != super.visibility())
|
if (function.visibility() != super.visibility())
|
||||||
overrideError(function, super, "Overriding function visibility differs.");
|
overrideError(function, super, "Overriding function visibility differs.");
|
||||||
|
|
||||||
if (function.isDeclaredConst() && !super.isDeclaredConst())
|
else if (function.isDeclaredConst() && !super.isDeclaredConst())
|
||||||
overrideError(function, super, "Overriding function should not be declared constant.");
|
overrideError(function, super, "Overriding function should not be declared constant.");
|
||||||
|
|
||||||
if (!function.isDeclaredConst() && super.isDeclaredConst())
|
else if (!function.isDeclaredConst() && super.isDeclaredConst())
|
||||||
overrideError(function, super, "Overriding function should be declared constant.");
|
overrideError(function, super, "Overriding function should be declared constant.");
|
||||||
|
|
||||||
if (function.isPayable() && !super.isPayable())
|
else if (function.isPayable() && !super.isPayable())
|
||||||
overrideError(function, super, "Overriding function should not be declared payable.");
|
overrideError(function, super, "Overriding function should not be declared payable.");
|
||||||
|
|
||||||
if (!function.isPayable() && super.isPayable())
|
else if (!function.isPayable() && super.isPayable())
|
||||||
overrideError(function, super, "Overriding function should be declared payable.");
|
overrideError(function, super, "Overriding function should be declared payable.");
|
||||||
|
|
||||||
if (functionType != superType)
|
else if (functionType != superType)
|
||||||
overrideError(function, super, "Overriding function return types differ.");
|
overrideError(function, super, "Overriding function return types differ.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user