aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-12-18 20:56:37 +0800
committerchriseth <c@ethdev.com>2015-12-18 20:56:37 +0800
commit79c5d032fee1d9e96db9540dbafd312626d7711a (patch)
treee39ad6c364a7b1fe68c2b5587f5a5eb3c24c8b78
parent938ed70935a434babb8c52e6a2985b98216b37c6 (diff)
downloaddexon-solidity-79c5d032fee1d9e96db9540dbafd312626d7711a.tar
dexon-solidity-79c5d032fee1d9e96db9540dbafd312626d7711a.tar.gz
dexon-solidity-79c5d032fee1d9e96db9540dbafd312626d7711a.tar.bz2
dexon-solidity-79c5d032fee1d9e96db9540dbafd312626d7711a.tar.lz
dexon-solidity-79c5d032fee1d9e96db9540dbafd312626d7711a.tar.xz
dexon-solidity-79c5d032fee1d9e96db9540dbafd312626d7711a.tar.zst
dexon-solidity-79c5d032fee1d9e96db9540dbafd312626d7711a.zip
Fix bug preventing overloads of different array types.
-rw-r--r--libsolidity/ast/Types.cpp2
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp11
2 files changed, 13 insertions, 0 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index 49347022..e5a120ee 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -831,6 +831,8 @@ bool ArrayType::operator==(Type const& _other) const
other.isDynamicallySized() != isDynamicallySized()
)
return false;
+ if (*other.baseType() != *baseType())
+ return false;
return isDynamicallySized() || length() == other.length();
}
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 1242e801..45ac48aa 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -2743,6 +2743,17 @@ BOOST_AUTO_TEST_CASE(invalid_args_creating_memory_array)
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
}
+BOOST_AUTO_TEST_CASE(function_overload_array_type)
+{
+ char const* text = R"(
+ contract M {
+ function f(uint[] values);
+ function f(int[] values);
+ }
+ )";
+ BOOST_CHECK(success(text));
+}
+
/*BOOST_AUTO_TEST_CASE(inline_array_declaration_and_passing)
{
char const* text = R"(