aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorErik Kundt <bitshift@posteo.org>2018-07-07 04:53:55 +0800
committerErik Kundt <bitshift@posteo.org>2018-07-11 07:56:07 +0800
commit0b960f5a9cde145775e5e24a52ac48e32d0969af (patch)
tree079e272bf871b874463f9877263c8f5964489419 /libsolidity
parentd84976dc871a1fdfab233650b989af69e325bf2b (diff)
downloaddexon-solidity-0b960f5a9cde145775e5e24a52ac48e32d0969af.tar.gz
dexon-solidity-0b960f5a9cde145775e5e24a52ac48e32d0969af.tar.zst
dexon-solidity-0b960f5a9cde145775e5e24a52ac48e32d0969af.zip
Turns wrong argument count in base constructor call into en error.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp31
1 files changed, 9 insertions, 22 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 78536664..1678e5a5 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -548,31 +548,18 @@ void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance)
if (arguments)
{
- bool v050 = m_scope->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050);
-
if (parameterTypes.size() != arguments->size())
{
- if (arguments->size() == 0 && !v050)
- m_errorReporter.warning(
- _inheritance.location(),
- "Wrong argument count for constructor call: " +
- toString(arguments->size()) +
- " arguments given but expected " +
- toString(parameterTypes.size()) +
- "."
- );
- else
- {
- m_errorReporter.typeError(
- _inheritance.location(),
- "Wrong argument count for constructor call: " +
- toString(arguments->size()) +
- " arguments given but expected " +
- toString(parameterTypes.size()) +
- "."
- );
+ m_errorReporter.typeError(
+ _inheritance.location(),
+ "Wrong argument count for constructor call: " +
+ toString(arguments->size()) +
+ " arguments given but expected " +
+ toString(parameterTypes.size()) +
+ "."
+ );
+ if (arguments->size() != 0)
return;
- }
}
for (size_t i = 0; i < arguments->size(); ++i)
if (!type(*(*arguments)[i])->isImplicitlyConvertibleTo(*parameterTypes[i]))