aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-02-02 04:47:56 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-02-02 05:35:32 +0800
commitee147e14d392e62dae92d345735ec768bd486633 (patch)
treec8cd95b2eb13808f2b6ff3c07c5c70398fcc5cb7 /test/libsolidity
parentbab7f8f455dae78c4da1019b131abd01d28f63a6 (diff)
downloaddexon-solidity-ee147e14d392e62dae92d345735ec768bd486633.tar
dexon-solidity-ee147e14d392e62dae92d345735ec768bd486633.tar.gz
dexon-solidity-ee147e14d392e62dae92d345735ec768bd486633.tar.bz2
dexon-solidity-ee147e14d392e62dae92d345735ec768bd486633.tar.lz
dexon-solidity-ee147e14d392e62dae92d345735ec768bd486633.tar.xz
dexon-solidity-ee147e14d392e62dae92d345735ec768bd486633.tar.zst
dexon-solidity-ee147e14d392e62dae92d345735ec768bd486633.zip
Cover both failure cases
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp14
1 files changed, 13 insertions, 1 deletions
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)