From ec82706396aa1770851223d59c0efdde7407fda0 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 21 Aug 2017 16:22:20 +0200 Subject: Fix crash related to ``using for`` without a library. --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test') 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"( -- cgit v1.2.3