diff options
author | chriseth <chris@ethereum.org> | 2018-11-22 21:57:37 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-11-26 21:30:32 +0800 |
commit | 939365a1d5bec0f4c61f18bb5744189f39734198 (patch) | |
tree | 31e53edfd82c6182f71042722170fe3a83b76a47 /libsolidity | |
parent | 9a4968ba1d1db573e57befe497cedc81eb2ef587 (diff) | |
download | dexon-solidity-939365a1d5bec0f4c61f18bb5744189f39734198.tar dexon-solidity-939365a1d5bec0f4c61f18bb5744189f39734198.tar.gz dexon-solidity-939365a1d5bec0f4c61f18bb5744189f39734198.tar.bz2 dexon-solidity-939365a1d5bec0f4c61f18bb5744189f39734198.tar.lz dexon-solidity-939365a1d5bec0f4c61f18bb5744189f39734198.tar.xz dexon-solidity-939365a1d5bec0f4c61f18bb5744189f39734198.tar.zst dexon-solidity-939365a1d5bec0f4c61f18bb5744189f39734198.zip |
Use callable types for override check.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 4d874197..f8ea357c 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -402,10 +402,10 @@ void TypeChecker::checkContractIllegalOverrides(ContractDefinition const& _contr void TypeChecker::checkFunctionOverride(FunctionDefinition const& _function, FunctionDefinition const& _super) { - FunctionType functionType(_function); - FunctionType superType(_super); + FunctionTypePointer functionType = FunctionType(_function).asCallableFunction(false); + FunctionTypePointer superType = FunctionType(_super).asCallableFunction(false); - if (!functionType.hasEqualParameterTypes(superType)) + if (!functionType->hasEqualParameterTypes(*superType)) return; if (!_function.annotation().superFunction) @@ -431,7 +431,7 @@ void TypeChecker::checkFunctionOverride(FunctionDefinition const& _function, Fun stateMutabilityToString(_function.stateMutability()) + "\"." ); - else if (functionType != superType) + else if (*functionType != *superType) overrideError(_function, _super, "Overriding function return types differ."); } |