Merge pull request #1421 from ethereum/test_memory_struct_from_library

test: add a test case about returning a struct in memory from a library
This commit is contained in:
chriseth 2016-11-23 12:17:23 +01:00 committed by GitHub
commit f3662ca498

View File

@ -2817,6 +2817,17 @@ BOOST_AUTO_TEST_CASE(using_for_not_used)
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
}
BOOST_AUTO_TEST_CASE(library_memory_struct)
{
char const* text = R"(
library c {
struct S { uint x; }
function f() returns (S ) {}
}
)";
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
}
BOOST_AUTO_TEST_CASE(using_for_arbitrary_mismatch)
{
// Bound to a, but self type does not match.