mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Limit each duplicate declaration error to 32 references
This commit is contained in:
parent
8bb96eaaf5
commit
0259459b21
@ -4,6 +4,7 @@ Features:
|
||||
* Optimizer: Add new optimization step to remove unused ``JUMPDEST``s.
|
||||
* Type Checker: Display helpful warning for unused function arguments/return parameters.
|
||||
* Type Checker: Do not show the same error multiple times for events.
|
||||
* Type Checker: Greatly reduce the number of duplicate errors shown for duplicate constructors and functions.
|
||||
* Type Checker: Warn on using literals as tight packing parameters in ``keccak256``, ``sha3``, ``sha256`` and ``ripemd160``.
|
||||
|
||||
Bugfixes:
|
||||
|
@ -164,10 +164,18 @@ void TypeChecker::checkContractDuplicateFunctions(ContractDefinition const& _con
|
||||
for (; it != functions[_contract.name()].end(); ++it)
|
||||
ssl.append("Another declaration is here:", (*it)->location());
|
||||
|
||||
string msg = "More than one constructor defined.";
|
||||
size_t occurrences = ssl.infos.size();
|
||||
if (occurrences > 32)
|
||||
{
|
||||
ssl.infos.resize(32);
|
||||
msg += " Truncated from " + boost::lexical_cast<string>(occurrences) + " to the first 32 occurrences.";
|
||||
}
|
||||
|
||||
m_errorReporter.declarationError(
|
||||
functions[_contract.name()].front()->location(),
|
||||
ssl,
|
||||
"More than one constructor defined."
|
||||
msg
|
||||
);
|
||||
}
|
||||
for (auto const& it: functions)
|
||||
@ -186,11 +194,21 @@ void TypeChecker::checkContractDuplicateFunctions(ContractDefinition const& _con
|
||||
}
|
||||
|
||||
if (ssl.infos.size() > 0)
|
||||
{
|
||||
string msg = "Function with same name and arguments defined twice.";
|
||||
size_t occurrences = ssl.infos.size();
|
||||
if (occurrences > 32)
|
||||
{
|
||||
ssl.infos.resize(32);
|
||||
msg += " Truncated from " + boost::lexical_cast<string>(occurrences) + " to the first 32 occurrences.";
|
||||
}
|
||||
|
||||
m_errorReporter.declarationError(
|
||||
overloads[i]->location(),
|
||||
ssl,
|
||||
"Function with same name and arguments defined twice."
|
||||
msg
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user