Bugfix for functions override

- Functions with byte array type parameters can now be safely
  overriden. Parameter location is now set at the right place.

- Also made a test for the fix
This commit is contained in:
Lefteris Karapetsas 2015-02-19 17:43:53 +01:00
parent 98739c362a
commit 0398ef109c

View File

@ -1163,6 +1163,19 @@ BOOST_AUTO_TEST_CASE(external_argument_delete)
BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError);
}
BOOST_AUTO_TEST_CASE(test_for_bug_override_function_with_bytearray_type)
{
char const* sourceCode = R"(
contract Vehicle {
function f(bytes _a) external returns (uint256 r) {r = 1;}
}
contract Bike is Vehicle {
function f(bytes _a) external returns (uint256 r) {r = 42;}
}
)";
BOOST_CHECK_NO_THROW(parseTextAndResolveNamesWithChecks(sourceCode));
}
BOOST_AUTO_TEST_SUITE_END()
}