aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-12-03 05:53:36 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-02-01 20:23:47 +0800
commitef7add8c2bfacea43aa32455c80ac9575aa46a67 (patch)
treee04a751aa99c4359f8c08fecedb04bec1645eda6
parentce62c7c01c01c859f6b310309a186a966e835d77 (diff)
downloaddexon-solidity-ef7add8c2bfacea43aa32455c80ac9575aa46a67.tar.gz
dexon-solidity-ef7add8c2bfacea43aa32455c80ac9575aa46a67.tar.zst
dexon-solidity-ef7add8c2bfacea43aa32455c80ac9575aa46a67.zip
Add tests for explicity fuction type to address casting
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 472067ec..1aca7ab9 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -4725,6 +4725,18 @@ BOOST_AUTO_TEST_CASE(delete_external_function_type_invalid)
CHECK_ERROR(text, TypeError, "");
}
+BOOST_AUTO_TEST_CASE(external_function_type_to_address)
+{
+ char const* text = R"(
+ contract C {
+ function f() return (address) {
+ return address(this.f);
+ }
+ }
+ )";
+ CHECK_SUCCESS(text);
+}
+
BOOST_AUTO_TEST_CASE(invalid_fixed_point_literal)
{
char const* text = R"(