mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2408 from federicobond/constant-parameters
Fix segmentation fault with constant function parameters
This commit is contained in:
@@ -1597,6 +1597,16 @@ BOOST_AUTO_TEST_CASE(empty_name_input_parameter)
|
||||
CHECK_SUCCESS(text);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(constant_input_parameter)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract test {
|
||||
function f(uint[] constant a) { }
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR_ALLOW_MULTI(text, TypeError, "Illegal use of \"constant\" specifier.");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(empty_name_return_parameter)
|
||||
{
|
||||
char const* text = R"(
|
||||
@@ -5582,6 +5592,16 @@ BOOST_AUTO_TEST_CASE(interface_variables)
|
||||
CHECK_ERROR(text, TypeError, "Variables cannot be declared in interfaces");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(interface_function_parameters)
|
||||
{
|
||||
char const* text = R"(
|
||||
interface I {
|
||||
function f(uint a) returns(bool);
|
||||
}
|
||||
)";
|
||||
success(text);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(interface_enums)
|
||||
{
|
||||
char const* text = R"(
|
||||
|
||||
Reference in New Issue
Block a user