Fix bug preventing overloads of different array types.

This commit is contained in:
chriseth 2015-12-18 13:56:37 +01:00
parent 938ed70935
commit 79c5d032fe
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() other.isDynamicallySized() != isDynamicallySized()
) )
return false; return false;
if (*other.baseType() != *baseType())
return false;
return isDynamicallySized() || length() == other.length(); return isDynamicallySized() || length() == other.length();
} }

View File

@ -2743,6 +2743,17 @@ BOOST_AUTO_TEST_CASE(invalid_args_creating_memory_array)
BOOST_CHECK(expectError(text) == Error::Type::TypeError); 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) /*BOOST_AUTO_TEST_CASE(inline_array_declaration_and_passing)
{ {
char const* text = R"( char const* text = R"(