aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index d9e6a63d..85acd8bf 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -6884,6 +6884,38 @@ BOOST_AUTO_TEST_CASE(tight_packing_literals)
CHECK_WARNING(text, "The type of \"int_const 1\" was inferred as uint8.");
}
+BOOST_AUTO_TEST_CASE(non_external_fallback)
+{
+ char const* text = R"(
+ pragma experimental "v0.5.0";
+ contract C {
+ function () external { }
+ }
+ )";
+ CHECK_WARNING(text, "Experimental features are turned on.");
+ text = R"(
+ pragma experimental "v0.5.0";
+ contract C {
+ function () internal { }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Fallback function must be defined as \"external\".");
+ text = R"(
+ pragma experimental "v0.5.0";
+ contract C {
+ function () private { }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Fallback function must be defined as \"external\".");
+ text = R"(
+ pragma experimental "v0.5.0";
+ contract C {
+ function () public { }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Fallback function must be defined as \"external\".");
+}
+
BOOST_AUTO_TEST_SUITE_END()
}