diff options
author | chriseth <chris@ethereum.org> | 2017-09-18 22:38:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-18 22:38:55 +0800 |
commit | 3a9a9db6d688f3a1ef3bbcb0a378bbd14779abde (patch) | |
tree | 736d85c93db1af500f61d9357198372c15c76744 /test | |
parent | 068a593d9c7ab31d1048199d262da3702f188bd3 (diff) | |
parent | a3380ea8d0e02da1eb68eb15906015faf4e8bc3c (diff) | |
download | dexon-solidity-3a9a9db6d688f3a1ef3bbcb0a378bbd14779abde.tar dexon-solidity-3a9a9db6d688f3a1ef3bbcb0a378bbd14779abde.tar.gz dexon-solidity-3a9a9db6d688f3a1ef3bbcb0a378bbd14779abde.tar.bz2 dexon-solidity-3a9a9db6d688f3a1ef3bbcb0a378bbd14779abde.tar.lz dexon-solidity-3a9a9db6d688f3a1ef3bbcb0a378bbd14779abde.tar.xz dexon-solidity-3a9a9db6d688f3a1ef3bbcb0a378bbd14779abde.tar.zst dexon-solidity-3a9a9db6d688f3a1ef3bbcb0a378bbd14779abde.zip |
Merge pull request #2910 from ethereum/fallback-restrict-external
Force fallback to be external (experimental 0.5.0 change)
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 32 |
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() } |