Merge pull request #4301 from rnaby/TypeChecker

Simplification of typeSupportedByOldABIEncoder
This commit is contained in:
chriseth 2018-06-21 18:53:31 +02:00 committed by GitHub
commit 32f2db780c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,15 +41,13 @@ bool typeSupportedByOldABIEncoder(Type const& _type)
{
if (_type.dataStoredIn(DataLocation::Storage))
return true;
else if (_type.category() == Type::Category::Struct)
if (_type.category() == Type::Category::Struct)
return false;
else if (_type.category() == Type::Category::Array)
if (_type.category() == Type::Category::Array)
{
auto const& arrayType = dynamic_cast<ArrayType const&>(_type);
auto base = arrayType.baseType();
if (!typeSupportedByOldABIEncoder(*base))
return false;
else if (base->category() == Type::Category::Array && base->isDynamicallySized())
if (!typeSupportedByOldABIEncoder(*base) || (base->category() == Type::Category::Array && base->isDynamicallySized()))
return false;
}
return true;