Merge pull request #4176 from sifmelcara/add/calldata-keyword

Add a new keyword, "calldata", to allow explicitly specify data location in external function's argument list
This commit is contained in:
chriseth
2018-05-30 14:42:50 +02:00
committed by GitHub
25 changed files with 155 additions and 25 deletions
@@ -6280,7 +6280,7 @@ BOOST_AUTO_TEST_CASE(unspecified_storage_v050)
}
}
)";
CHECK_ERROR(text, TypeError, "Storage location must be specified as either \"memory\" or \"storage\".");
CHECK_ERROR(text, TypeError, "Data location must be specified as either \"memory\" or \"storage\".");
}
BOOST_AUTO_TEST_CASE(storage_location_non_array_or_struct_disallowed)
@@ -6290,7 +6290,7 @@ BOOST_AUTO_TEST_CASE(storage_location_non_array_or_struct_disallowed)
function f(uint storage a) public { }
}
)";
CHECK_ERROR(text, TypeError, "Storage location can only be given for array or struct types.");
CHECK_ERROR(text, TypeError, "Data location can only be given for array or struct types.");
}
BOOST_AUTO_TEST_CASE(storage_location_non_array_or_struct_disallowed_is_not_fatal)
@@ -6302,7 +6302,7 @@ BOOST_AUTO_TEST_CASE(storage_location_non_array_or_struct_disallowed_is_not_fata
}
}
)";
CHECK_ERROR_ALLOW_MULTI(text, TypeError, (std::vector<std::string>{"Storage location can only be given for array or struct types."}));
CHECK_ERROR_ALLOW_MULTI(text, TypeError, (std::vector<std::string>{"Data location can only be given for array or struct types."}));
}
BOOST_AUTO_TEST_CASE(implicit_conversion_disallowed)