aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityNameAndTypeResolution.cpp
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-11-23 00:09:22 +0800
committerYoichi Hirai <i@yoichihirai.com>2016-11-23 00:09:22 +0800
commit75686e3d753d86558261ac8dab81564f06a08bfa (patch)
treecc837ee4de96ddc9b4981390ddff834edb3c4fc3 /test/libsolidity/SolidityNameAndTypeResolution.cpp
parent1a205ebf783c61b6c92dd40d0e94f874dc21f7b0 (diff)
downloaddexon-solidity-75686e3d753d86558261ac8dab81564f06a08bfa.tar
dexon-solidity-75686e3d753d86558261ac8dab81564f06a08bfa.tar.gz
dexon-solidity-75686e3d753d86558261ac8dab81564f06a08bfa.tar.bz2
dexon-solidity-75686e3d753d86558261ac8dab81564f06a08bfa.tar.lz
dexon-solidity-75686e3d753d86558261ac8dab81564f06a08bfa.tar.xz
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
Diffstat (limited to 'test/libsolidity/SolidityNameAndTypeResolution.cpp')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp11
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.