aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-09-12 18:22:29 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-12 21:58:10 +0800
commit5ae9b8dab180b94bbbc5a7a791ddd9701f1108f0 (patch)
treeecdfdb912162f6bb09092d474bb2c6d3f0d928f9 /libsolidity/analysis
parentf2412da80002ad2ca686b8a64210c933ee2f1942 (diff)
downloaddexon-solidity-5ae9b8dab180b94bbbc5a7a791ddd9701f1108f0.tar
dexon-solidity-5ae9b8dab180b94bbbc5a7a791ddd9701f1108f0.tar.gz
dexon-solidity-5ae9b8dab180b94bbbc5a7a791ddd9701f1108f0.tar.bz2
dexon-solidity-5ae9b8dab180b94bbbc5a7a791ddd9701f1108f0.tar.lz
dexon-solidity-5ae9b8dab180b94bbbc5a7a791ddd9701f1108f0.tar.xz
dexon-solidity-5ae9b8dab180b94bbbc5a7a791ddd9701f1108f0.tar.zst
dexon-solidity-5ae9b8dab180b94bbbc5a7a791ddd9701f1108f0.zip
Do not report overload conflicts for every line excessively
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 3564ff32..87750c6e 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -173,13 +173,17 @@ void TypeChecker::checkContractDuplicateFunctions(ContractDefinition const& _con
for (auto const& it: functions)
{
vector<FunctionDefinition const*> const& overloads = it.second;
- for (size_t i = 0; i < overloads.size(); ++i)
+ set<size_t> reported;
+ for (size_t i = 0; i < overloads.size() && !reported.count(i); ++i)
{
SecondarySourceLocation ssl;
for (size_t j = i + 1; j < overloads.size(); ++j)
if (FunctionType(*overloads[i]).hasEqualArgumentTypes(FunctionType(*overloads[j])))
+ {
ssl.append("Other declaration is here:", overloads[j]->location());
+ reported.insert(j);
+ }
if (ssl.infos.size() > 0)
m_errorReporter.declarationError(