From 75686e3d753d86558261ac8dab81564f06a08bfa Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Tue, 22 Nov 2016 17:09:22 +0100 Subject: test: add a test case about returning a struct in memory from a library This fixes #1378 --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/libsolidity') diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 865eb7ce..82384589 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -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. -- cgit