diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-03 00:52:50 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-03 00:52:50 +0800 |
commit | 8cd3d4b4b7a440815229288d853b6ed81ba4eb43 (patch) | |
tree | 9f8f245579ca51d175cba2d962c6f1e26b665281 /Types.cpp | |
parent | 5a374afe62ad2175f16d1c5d4a6e7a07cdea41d2 (diff) | |
download | dexon-solidity-8cd3d4b4b7a440815229288d853b6ed81ba4eb43.tar.gz dexon-solidity-8cd3d4b4b7a440815229288d853b6ed81ba4eb43.tar.zst dexon-solidity-8cd3d4b4b7a440815229288d853b6ed81ba4eb43.zip |
Accessors for multiple mappings implemented
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -626,20 +626,20 @@ FunctionType::FunctionType(VariableDeclaration const& _varDecl): TypePointers retParams; vector<string> retParamNames; TypePointer varDeclType = _varDecl.getType(); - auto mappingType = dynamic_cast<const MappingType*>(varDeclType.get()); - if (mappingType!= nullptr) - { - params.push_back(mappingType->getKeyType()); - paramNames.push_back(mappingType->getKeyType()->toString()); + auto mappingType = dynamic_cast<MappingType const*>(varDeclType.get()); + auto returnType = varDeclType; - retParams.push_back(mappingType->getValueType()); - retParamNames.push_back(mappingType->getValueType()->toString()); - } - else // elelemntary type + while (mappingType!= nullptr) { - retParams.push_back(varDeclType); - retParamNames.push_back(_varDecl.getName()); + params.push_back(mappingType->getKeyType()); + paramNames.push_back(""); + returnType = mappingType->getValueType(); + mappingType = dynamic_cast<MappingType const*>(mappingType->getValueType().get()); } + + retParams.push_back(returnType); + retParamNames.push_back(""); + swap(params, m_parameterTypes); swap(paramNames, m_parameterNames); swap(retParams, m_returnParameterTypes); |