diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-11-23 00:09:22 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2016-11-23 00:09:22 +0800 |
commit | 75686e3d753d86558261ac8dab81564f06a08bfa (patch) | |
tree | cc837ee4de96ddc9b4981390ddff834edb3c4fc3 | |
parent | 1a205ebf783c61b6c92dd40d0e94f874dc21f7b0 (diff) | |
download | dexon-solidity-75686e3d753d86558261ac8dab81564f06a08bfa.tar.gz dexon-solidity-75686e3d753d86558261ac8dab81564f06a08bfa.tar.zst dexon-solidity-75686e3d753d86558261ac8dab81564f06a08bfa.zip |
test: add a test case about returning a struct in memory from a library
This fixes #1378
-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. |