diff options
author | chriseth <chris@ethereum.org> | 2016-11-23 19:17:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-23 19:17:23 +0800 |
commit | f3662ca49866f1223701d6107a7dbe78a6601b67 (patch) | |
tree | 629cb712bd3d7151a4409f1022b118d198975eca | |
parent | d25fb2f243476b07931ac2fdd2500b954a0cd4de (diff) | |
parent | 75686e3d753d86558261ac8dab81564f06a08bfa (diff) | |
download | dexon-solidity-f3662ca49866f1223701d6107a7dbe78a6601b67.tar.gz dexon-solidity-f3662ca49866f1223701d6107a7dbe78a6601b67.tar.zst dexon-solidity-f3662ca49866f1223701d6107a7dbe78a6601b67.zip |
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
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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. |