test: add a test case about returning a struct in memory from a library

This fixes #1378
This commit is contained in:
Yoichi Hirai 2016-11-22 17:09:22 +01:00
parent 1a205ebf78
commit 75686e3d75
No known key found for this signature in database
GPG Key ID: E7B75D080FCF7992

View File

@ -2817,6 +2817,17 @@ BOOST_AUTO_TEST_CASE(using_for_not_used)
BOOST_CHECK(expectError(text) == Error::Type::TypeError); 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) BOOST_AUTO_TEST_CASE(using_for_arbitrary_mismatch)
{ {
// Bound to a, but self type does not match. // Bound to a, but self type does not match.