diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-16 23:10:23 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-18 18:58:37 +0800 |
commit | a3380ea8d0e02da1eb68eb15906015faf4e8bc3c (patch) | |
tree | 6e1024d4f7ad80a5f46a3b1ee471183146e3f82c /test | |
parent | c289fd3d9eded048f229add7f6c7f1cfd201b32d (diff) | |
download | dexon-solidity-a3380ea8d0e02da1eb68eb15906015faf4e8bc3c.tar dexon-solidity-a3380ea8d0e02da1eb68eb15906015faf4e8bc3c.tar.gz dexon-solidity-a3380ea8d0e02da1eb68eb15906015faf4e8bc3c.tar.bz2 dexon-solidity-a3380ea8d0e02da1eb68eb15906015faf4e8bc3c.tar.lz dexon-solidity-a3380ea8d0e02da1eb68eb15906015faf4e8bc3c.tar.xz dexon-solidity-a3380ea8d0e02da1eb68eb15906015faf4e8bc3c.tar.zst dexon-solidity-a3380ea8d0e02da1eb68eb15906015faf4e8bc3c.zip |
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 8c271fe1..be3b56f3 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -6691,6 +6691,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() } |