aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorLiana Husikyan <liana@ethdev.com>2015-04-01 20:22:42 +0800
committerLiana Husikyan <liana@ethdev.com>2015-04-08 21:56:35 +0800
commitfb1cf35f3b624b01c56cca4cb1f919134a34082e (patch)
treeeb3ad7b041863afad90551b6de2e8aa78d56b29a /Types.cpp
parentdf3ce3ad8f365ab7842823f4694490ad80a651c5 (diff)
downloaddexon-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.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/Types.cpp b/Types.cpp
index 9a5b120b..9ac909da 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -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
{