diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 074b644b7..ff8cc87cd 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -365,7 +365,7 @@ void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance) toString(arguments->size()) + " arguments given but expected " + toString(parameterTypes.size()) + - ". Remove parentheses if you do not want to provide arguments here." + (arguments->size() == 0 ? ". Remove parentheses if you do not want to provide arguments here." : "") ); } for (size_t i = 0; i < std::min(arguments->size(), parameterTypes.size()); ++i) diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_and_modifier_lists.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_and_modifier_lists.sol index 290afd91b..08193b6da 100644 --- a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_and_modifier_lists.sol +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_and_modifier_lists.sol @@ -7,7 +7,7 @@ contract E is C(1) { constructor() C(1) {} } // ---- // DeclarationError 3364: (93-108): Base constructor arguments given twice. // DeclarationError 3364: (149-153): Base constructor arguments given twice. -// TypeError 7927: (61-76): Wrong argument count for constructor call: 3 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 7927: (61-76): Wrong argument count for constructor call: 3 arguments given but expected 2 // TypeError 2973: (93-108): Wrong argument count for modifier invocation: 3 arguments given but expected 2. -// TypeError 7927: (128-132): Wrong argument count for constructor call: 1 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 7927: (128-132): Wrong argument count for constructor call: 1 arguments given but expected 2 // TypeError 2973: (149-153): Wrong argument count for modifier invocation: 1 arguments given but expected 2. diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list.sol index 2a933e3f0..f20462484 100644 --- a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list.sol +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list.sol @@ -5,5 +5,5 @@ contract C { contract D is C(1, true, "a") {} contract E is C(1) {} // ---- -// TypeError 7927: (61-76): Wrong argument count for constructor call: 3 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. -// TypeError 7927: (94-98): Wrong argument count for constructor call: 1 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 7927: (61-76): Wrong argument count for constructor call: 3 arguments given but expected 2 +// TypeError 7927: (94-98): Wrong argument count for constructor call: 1 arguments given but expected 2 diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_abstract.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_abstract.sol index 4974cdbc1..b7b619d84 100644 --- a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_abstract.sol +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_abstract.sol @@ -5,5 +5,5 @@ abstract contract C { abstract contract D is C(1, true, "a") {} abstract contract E is C(1) {} // ---- -// TypeError 7927: (79-94): Wrong argument count for constructor call: 3 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. -// TypeError 7927: (121-125): Wrong argument count for constructor call: 1 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 7927: (79-94): Wrong argument count for constructor call: 3 arguments given but expected 2 +// TypeError 7927: (121-125): Wrong argument count for constructor call: 1 arguments given but expected 2 diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_with_derived_constructor.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_with_derived_constructor.sol index 02113c04b..ff8a0f93b 100644 --- a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_with_derived_constructor.sol +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_with_derived_constructor.sol @@ -5,5 +5,5 @@ contract C { contract D is C(1, true, "a") { constructor() {} } contract E is C(1) { constructor() {} } // ---- -// TypeError 7927: (61-76): Wrong argument count for constructor call: 3 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. -// TypeError 7927: (112-116): Wrong argument count for constructor call: 1 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 7927: (61-76): Wrong argument count for constructor call: 3 arguments given but expected 2 +// TypeError 7927: (112-116): Wrong argument count for constructor call: 1 arguments given but expected 2 diff --git a/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol b/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol index d3f33f6d6..4042e0089 100644 --- a/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol +++ b/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol @@ -6,5 +6,5 @@ contract Derived2 is Base { constructor() Base(2) { } } // ---- -// TypeError 7927: (67-74): Wrong argument count for constructor call: 1 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 7927: (67-74): Wrong argument count for constructor call: 1 arguments given but expected 2 // TypeError 2973: (123-130): Wrong argument count for modifier invocation: 1 arguments given but expected 2. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol index f1ffa651f..88396f8c6 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol @@ -1,4 +1,4 @@ interface I {} contract C is I(2) {} // ---- -// TypeError 7927: (29-33): Wrong argument count for constructor call: 1 arguments given but expected 0. Remove parentheses if you do not want to provide arguments here. +// TypeError 7927: (29-33): Wrong argument count for constructor call: 1 arguments given but expected 0