diff options
author | chriseth <chris@ethereum.org> | 2017-08-21 22:22:20 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-08-21 22:57:37 +0800 |
commit | ec82706396aa1770851223d59c0efdde7407fda0 (patch) | |
tree | bff7e508a449c1efc9fd5357bb957f7e84156d4c /test/libsolidity | |
parent | d270879c8ff4447417c1c0cfce0b008b4df7bc9c (diff) | |
download | dexon-solidity-ec82706396aa1770851223d59c0efdde7407fda0.tar.gz dexon-solidity-ec82706396aa1770851223d59c0efdde7407fda0.tar.zst dexon-solidity-ec82706396aa1770851223d59c0efdde7407fda0.zip |
Fix crash related to ``using for`` without a library.
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index fad1ca61..e349bf83 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -6657,6 +6657,21 @@ BOOST_AUTO_TEST_CASE(library_function_without_implementation) CHECK_ERROR(text, TypeError, "Internal library function must be implemented if declared."); } +BOOST_AUTO_TEST_CASE(using_for_with_non_library) +{ + // This tests a crash that was resolved by making the first error fatal. + char const* text = R"( + library L { + struct S { uint d; } + using S for S; + function f(S _s) internal { + _s.d = 1; + } + } + )"; + CHECK_ERROR(text, TypeError, "Library name expected."); +} + BOOST_AUTO_TEST_CASE(experimental_pragma) { char const* text = R"( |