mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Contract level checker: Disallow free function redefinition and alias
shadowing another free function Co-authored-by: chriseth <chris@ethereum.org>
This commit is contained in:
co-authored by
chriseth
parent
1cc0d642e8
commit
e2a2276272
@@ -39,7 +39,7 @@ namespace solidity::frontend
|
||||
|
||||
/**
|
||||
* Component that verifies overloads, abstract contracts, function clashes and others
|
||||
* checks at contract or function level.
|
||||
* checks at file, contract, or function level.
|
||||
*/
|
||||
class ContractLevelChecker
|
||||
{
|
||||
@@ -51,11 +51,14 @@ public:
|
||||
m_errorReporter(_errorReporter)
|
||||
{}
|
||||
|
||||
/// Performs checks on the given source ast.
|
||||
/// @returns true iff all checks passed. Note even if all checks passed, errors() can still contain warnings
|
||||
bool check(SourceUnit const& _sourceUnit);
|
||||
|
||||
private:
|
||||
/// Performs checks on the given contract.
|
||||
/// @returns true iff all checks passed. Note even if all checks passed, errors() can still contain warnings
|
||||
bool check(ContractDefinition const& _contract);
|
||||
|
||||
private:
|
||||
/// Checks that two functions defined in this contract with the same name have different
|
||||
/// arguments and that there is at most one constructor.
|
||||
void checkDuplicateFunctions(ContractDefinition const& _contract);
|
||||
|
||||
Reference in New Issue
Block a user