diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-22 02:47:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-22 02:47:57 +0800 |
commit | 2c2ae74217521aae93b9c7b058ce8687046c648c (patch) | |
tree | bf495e713944956c52d82f79356d86586d0de26b /test | |
parent | 4219acaba98b22d6c7b118682480b180e5196f46 (diff) | |
parent | ec82706396aa1770851223d59c0efdde7407fda0 (diff) | |
download | dexon-solidity-2c2ae74217521aae93b9c7b058ce8687046c648c.tar dexon-solidity-2c2ae74217521aae93b9c7b058ce8687046c648c.tar.gz dexon-solidity-2c2ae74217521aae93b9c7b058ce8687046c648c.tar.bz2 dexon-solidity-2c2ae74217521aae93b9c7b058ce8687046c648c.tar.lz dexon-solidity-2c2ae74217521aae93b9c7b058ce8687046c648c.tar.xz dexon-solidity-2c2ae74217521aae93b9c7b058ce8687046c648c.tar.zst dexon-solidity-2c2ae74217521aae93b9c7b058ce8687046c648c.zip |
Merge pull request #2773 from ethereum/usingForWithoutLibrary
Fix crash related to ``using for`` without a library.
Diffstat (limited to 'test')
-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"( |