aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/SolidityNameAndTypeResolution.cpp
diff options
context:
space:
mode:
authorLiana Husikyan <liana@ethdev.com>2015-05-11 19:47:21 +0800
committerLiana Husikyan <liana@ethdev.com>2015-05-11 22:46:17 +0800
commitccc3d56542d76ce19ce994716e8d7afc339e7472 (patch)
tree22c4ed1b49a91c5f51655b6b90eaba198910fda2 /libsolidity/SolidityNameAndTypeResolution.cpp
parent2cc62fbbfba89afaa2d83728ebb5b5c4488dd110 (diff)
downloaddexon-solidity-ccc3d56542d76ce19ce994716e8d7afc339e7472.tar.gz
dexon-solidity-ccc3d56542d76ce19ce994716e8d7afc339e7472.tar.zst
dexon-solidity-ccc3d56542d76ce19ce994716e8d7afc339e7472.zip
bug in abi. fixed external type for return parameters
Diffstat (limited to 'libsolidity/SolidityNameAndTypeResolution.cpp')
-rw-r--r--libsolidity/SolidityNameAndTypeResolution.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/libsolidity/SolidityNameAndTypeResolution.cpp b/libsolidity/SolidityNameAndTypeResolution.cpp
index c317dad9..c59c1f56 100644
--- a/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -508,6 +508,28 @@ BOOST_AUTO_TEST_CASE(function_external_types)
}
}
+BOOST_AUTO_TEST_CASE(enum_external_type)
+{
+ // bug #1801
+ ASTPointer<SourceUnit> sourceUnit;
+ char const* text = R"(
+ contract Test {
+ enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }
+ function boo(ActionChoices enumArg) external returns (uint ret) {
+ ret = 5;
+ }
+ })";
+ ETH_TEST_REQUIRE_NO_THROW(sourceUnit = parseTextAndResolveNames(text), "Parsing and name Resolving failed");
+ for (ASTPointer<ASTNode> const& node: sourceUnit->getNodes())
+ if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
+ {
+ auto functions = contract->getDefinedFunctions();
+ if (functions.empty())
+ continue;
+ BOOST_CHECK_EQUAL("boo(uint8)", functions[0]->externalSignature());
+ }
+}
+
BOOST_AUTO_TEST_CASE(function_external_call_allowed_conversion)
{
char const* text = R"(