mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
test: add a test case about returning a struct in memory from a library
This fixes #1378
This commit is contained in:
parent
1a205ebf78
commit
75686e3d75
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user