From 3571db6e3f54476cdabaf4861100564ae4b00a6a Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Fri, 21 Jul 2017 01:11:16 -0300 Subject: Avoid duplicate errors due to function overrides --- libsolidity/analysis/TypeChecker.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libsolidity/analysis') diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 2a9ca5a8..8dd45a90 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -308,19 +308,19 @@ void TypeChecker::checkFunctionOverride(FunctionDefinition const& function, Func if (function.visibility() != super.visibility()) overrideError(function, super, "Overriding function visibility differs."); - if (function.isDeclaredConst() && !super.isDeclaredConst()) + else if (function.isDeclaredConst() && !super.isDeclaredConst()) overrideError(function, super, "Overriding function should not be declared constant."); - if (!function.isDeclaredConst() && super.isDeclaredConst()) + else if (!function.isDeclaredConst() && super.isDeclaredConst()) overrideError(function, super, "Overriding function should be declared constant."); - if (function.isPayable() && !super.isPayable()) + else if (function.isPayable() && !super.isPayable()) overrideError(function, super, "Overriding function should not be declared payable."); - if (!function.isPayable() && super.isPayable()) + else if (!function.isPayable() && super.isPayable()) overrideError(function, super, "Overriding function should be declared payable."); - if (functionType != superType) + else if (functionType != superType) overrideError(function, super, "Overriding function return types differ."); } -- cgit v1.2.3