diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 48b58b719..d7f7961a5 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -97,13 +97,20 @@ parseAnalyseAndReturnError(string const& _source, bool _reportWarnings = false) return make_pair(sourceUnit, std::make_shared(currentError->type())); } } + catch (InternalCompilerError const& _e) + { + string message("Internal compiler error"); + if (string const* description = boost::get_error_info(_e)) + message += ": " + *description; + BOOST_FAIL(message); + } catch (Error const& _e) { return make_pair(sourceUnit, std::make_shared(_e.type())); } - catch (Exception const& /*_exception*/) + catch (...) { - return make_pair(sourceUnit, nullptr); + BOOST_FAIL("Unexpected exception."); } return make_pair(sourceUnit, nullptr); } @@ -3516,6 +3523,19 @@ BOOST_AUTO_TEST_CASE(inline_array_rationals) BOOST_CHECK(success(text)); } +BOOST_AUTO_TEST_CASE(rational_index_access) +{ + char const* text = R"( + contract test { + function f() { + uint[] memory a; + a[.5]; + } + } + )"; + BOOST_CHECK(!success(text)); +} + BOOST_AUTO_TEST_CASE(rational_to_fixed_literal_expression) { char const* text = R"( @@ -3578,6 +3598,18 @@ BOOST_AUTO_TEST_CASE(var_capable_of_holding_constant_rationals) BOOST_CHECK(success(text)); } +BOOST_AUTO_TEST_CASE(var_and_rational_with_tuple) +{ + char const* text = R"( + contract test { + function f() { + var (a, b) = (.5, 1/3); + } + } + )"; + BOOST_CHECK(success(text)); +} + BOOST_AUTO_TEST_CASE(var_handle_divided_integers) { char const* text = R"(