From ee147e14d392e62dae92d345735ec768bd486633 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 1 Feb 2017 20:47:56 +0000 Subject: Cover both failure cases --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'test/libsolidity') diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 587f1075..f5768022 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -4746,7 +4746,19 @@ BOOST_AUTO_TEST_CASE(internal_function_type_to_address) } } )"; - CHECK_ERROR(text, TypeError, ""); + CHECK_ERROR(text, TypeError, "Explicit type conversion not allowed"); +} + +BOOST_AUTO_TEST_CASE(external_function_type_to_uint) +{ + char const* text = R"( + contract C { + function f() returns (uint) { + return uint(this.f); + } + } + )"; + CHECK_ERROR(text, TypeError, "Explicit type conversion not allowed"); } BOOST_AUTO_TEST_CASE(invalid_fixed_point_literal) -- cgit