Merge pull request #308 from chriseth/fixoverloadbug

Fix bug preventing overloads of different array types.
This commit is contained in:
chriseth 2015-12-21 15:37:51 +01:00
commit 2466fb68a0
2 changed files with 13 additions and 0 deletions

View File

@ -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();
}

View File

@ -2758,6 +2758,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"(