diff options
author | chriseth <c@ethdev.com> | 2015-04-15 23:43:23 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-04-15 23:43:23 +0800 |
commit | c7b428fdb14fac12564d52f25f6101b3e38ace46 (patch) | |
tree | fb42b93091694ca5a0b4ba834cecc3b09dcf1669 /Types.cpp | |
parent | 0c69d5fdcd3286f47c81dbcbcfb8802861eab8b5 (diff) | |
parent | e1b20fb3a10f629aff172399c6e6111c941f931d (diff) | |
download | dexon-solidity-c7b428fdb14fac12564d52f25f6101b3e38ace46.tar.gz dexon-solidity-c7b428fdb14fac12564d52f25f6101b3e38ace46.tar.zst dexon-solidity-c7b428fdb14fac12564d52f25f6101b3e38ace46.zip |
Merge remote-tracking branch 'ethereum/develop' into sol_overloadingFunctions
Conflicts:
libsolidity/Types.cpp
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
@@ -1000,15 +1000,26 @@ FunctionType::FunctionType(FunctionDefinition const& _function, bool _isInternal FunctionType::FunctionType(VariableDeclaration const& _varDecl): m_location(Location::External), m_isConstant(true), m_declaration(&_varDecl) { - TypePointers params; + TypePointers paramTypes; vector<string> paramNames; auto returnType = _varDecl.getType(); - while (auto mappingType = dynamic_cast<MappingType const*>(returnType.get())) + while (true) { - params.push_back(mappingType->getKeyType()); - paramNames.push_back(""); - returnType = mappingType->getValueType(); + if (auto mappingType = dynamic_cast<MappingType const*>(returnType.get())) + { + paramTypes.push_back(mappingType->getKeyType()); + paramNames.push_back(""); + returnType = mappingType->getValueType(); + } + else if (auto arrayType = dynamic_cast<ArrayType const*>(returnType.get())) + { + returnType = arrayType->getBaseType(); + paramNames.push_back(""); + paramTypes.push_back(make_shared<IntegerType>(256)); + } + else + break; } TypePointers retParams; @@ -1016,7 +1027,7 @@ FunctionType::FunctionType(VariableDeclaration const& _varDecl): if (auto structType = dynamic_cast<StructType const*>(returnType.get())) { for (auto const& member: structType->getMembers()) - if (member.type->canLiveOutsideStorage()) + if (member.type->getCategory() != Category::Mapping && member.type->getCategory() != Category::Array) { retParamNames.push_back(member.name); retParams.push_back(member.type); @@ -1028,7 +1039,7 @@ FunctionType::FunctionType(VariableDeclaration const& _varDecl): retParamNames.push_back(""); } - swap(params, m_parameterTypes); + swap(paramTypes, m_parameterTypes); swap(paramNames, m_parameterNames); swap(retParams, m_returnParameterTypes); swap(retParamNames, m_returnParameterNames); |