diff options
author | Federico Bond <federicobond@gmail.com> | 2017-07-21 12:11:16 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-12 05:45:26 +0800 |
commit | 3571db6e3f54476cdabaf4861100564ae4b00a6a (patch) | |
tree | 68d25d1f062ed105c7ab0d6eb7970540c6f4ae3d /libsolidity/analysis | |
parent | d4997dd9a3ec10767d8ee289207fdf0ea6b45f0a (diff) | |
download | dexon-solidity-3571db6e3f54476cdabaf4861100564ae4b00a6a.tar dexon-solidity-3571db6e3f54476cdabaf4861100564ae4b00a6a.tar.gz dexon-solidity-3571db6e3f54476cdabaf4861100564ae4b00a6a.tar.bz2 dexon-solidity-3571db6e3f54476cdabaf4861100564ae4b00a6a.tar.lz dexon-solidity-3571db6e3f54476cdabaf4861100564ae4b00a6a.tar.xz dexon-solidity-3571db6e3f54476cdabaf4861100564ae4b00a6a.tar.zst dexon-solidity-3571db6e3f54476cdabaf4861100564ae4b00a6a.zip |
Avoid duplicate errors due to function overrides
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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."); } |