diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-04-01 20:22:42 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-04-08 21:56:35 +0800 |
commit | fb1cf35f3b624b01c56cca4cb1f919134a34082e (patch) | |
tree | eb3ad7b041863afad90551b6de2e8aa78d56b29a /Types.cpp | |
parent | df3ce3ad8f365ab7842823f4694490ad80a651c5 (diff) | |
download | dexon-solidity-fb1cf35f3b624b01c56cca4cb1f919134a34082e.tar.gz dexon-solidity-fb1cf35f3b624b01c56cca4cb1f919134a34082e.tar.zst dexon-solidity-fb1cf35f3b624b01c56cca4cb1f919134a34082e.zip |
added implementation to append code for State variable accessor
fixed tests
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -985,11 +985,23 @@ FunctionType::FunctionType(VariableDeclaration const& _varDecl): 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(); + auto mappingType = dynamic_cast<MappingType const*>(returnType.get()); + auto arrayType = dynamic_cast<ArrayType const*>(returnType.get()); + if (mappingType) + { + params.push_back(mappingType->getKeyType()); + paramNames.push_back(""); + returnType = mappingType->getValueType(); + } + else if (arrayType) + { + returnType = arrayType->getBaseType(); + params.push_back(make_shared<IntegerType>(256)); + } + else + break; } TypePointers retParams; @@ -1002,11 +1014,6 @@ FunctionType::FunctionType(VariableDeclaration const& _varDecl): retParamNames.push_back(member.first); retParams.push_back(member.second); } - } else if (auto arrayType = dynamic_cast<ArrayType const*>(returnType.get())) - { - params.push_back(make_shared<IntegerType>(256)); - paramNames.push_back(""); - returnType = arrayType->getBaseType(); } else { |