aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/Compiler.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-11-01 06:13:45 +0800
committerchriseth <c@ethdev.com>2015-11-01 06:13:45 +0800
commita5c227778d7f0145434147830bd07a16f0f72134 (patch)
treee92ab4d3ccd6bfbd7c0b89a9ffde4eb8d88f2251 /libsolidity/codegen/Compiler.cpp
parent56f5d5885090a03ea9223f2210e70b6c78a1cb75 (diff)
downloaddexon-solidity-a5c227778d7f0145434147830bd07a16f0f72134.tar.gz
dexon-solidity-a5c227778d7f0145434147830bd07a16f0f72134.tar.zst
dexon-solidity-a5c227778d7f0145434147830bd07a16f0f72134.zip
Bugfix: Returning literal strings in tuples.
Diffstat (limited to 'libsolidity/codegen/Compiler.cpp')
-rw-r--r--libsolidity/codegen/Compiler.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libsolidity/codegen/Compiler.cpp b/libsolidity/codegen/Compiler.cpp
index 457b1e02..5daa37de 100644
--- a/libsolidity/codegen/Compiler.cpp
+++ b/libsolidity/codegen/Compiler.cpp
@@ -606,7 +606,11 @@ bool Compiler::visit(Return const& _return)
for (auto const& retVariable: returnParameters)
types.push_back(retVariable->annotation().type);
- TypePointer expectedType = types.size() == 1 ? types.front() : make_shared<TupleType>(types);
+ TypePointer expectedType;
+ if (expression->annotation().type->category() == Type::Category::Tuple || types.size() != 1)
+ expectedType = make_shared<TupleType>(types);
+ else
+ expectedType = types.front();
compileExpression(*expression, expectedType);
for (auto const& retVariable: boost::adaptors::reverse(returnParameters))