aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-08-02 21:01:38 +0800
committerGitHub <noreply@github.com>2018-08-02 21:01:38 +0800
commit90a5928b883dc9bbc889269a4e86d3d32c79d8ca (patch)
treec5f1c13acbd203ae5cf3ef5f97717c72d6a80e9e /libsolidity/analysis
parentf7c96c8dee43652e5c9c52078db524c27bc29aec (diff)
parent7a8a243eef5551189c51c753463683097cf92f94 (diff)
downloaddexon-solidity-90a5928b883dc9bbc889269a4e86d3d32c79d8ca.tar
dexon-solidity-90a5928b883dc9bbc889269a4e86d3d32c79d8ca.tar.gz
dexon-solidity-90a5928b883dc9bbc889269a4e86d3d32c79d8ca.tar.bz2
dexon-solidity-90a5928b883dc9bbc889269a4e86d3d32c79d8ca.tar.lz
dexon-solidity-90a5928b883dc9bbc889269a4e86d3d32c79d8ca.tar.xz
dexon-solidity-90a5928b883dc9bbc889269a4e86d3d32c79d8ca.tar.zst
dexon-solidity-90a5928b883dc9bbc889269a4e86d3d32c79d8ca.zip
Merge pull request #4522 from ethereum/fullEncodingType
Isolate determining the encoding type into its own function.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 8f504ffe..8c84e4dc 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -1742,22 +1742,8 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
m_errorReporter.typeError(arguments[i]->location(), "Invalid rational number (too large or division by zero).");
errored = true;
}
- if (!errored)
- {
- TypePointer encodingType;
- if (
- argType->mobileType() &&
- argType->mobileType()->interfaceType(false) &&
- argType->mobileType()->interfaceType(false)->encodingType()
- )
- encodingType = argType->mobileType()->interfaceType(false)->encodingType();
- // Structs are fine as long as ABIV2 is activated and we do not do packed encoding.
- if (!encodingType || (
- dynamic_cast<StructType const*>(encodingType.get()) &&
- !(abiEncodeV2 && functionType->padArguments())
- ))
- m_errorReporter.typeError(arguments[i]->location(), "This type cannot be encoded.");
- }
+ if (!errored && !argType->fullEncodingType(false, abiEncodeV2, !functionType->padArguments()))
+ m_errorReporter.typeError(arguments[i]->location(), "This type cannot be encoded.");
}
else if (!type(*arguments[i])->isImplicitlyConvertibleTo(*parameterTypes[i]))
{