diff options
-rw-r--r-- | libsolidity/ast/ExperimentalFeatures.h | 8 | ||||
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 14 |
2 files changed, 13 insertions, 9 deletions
diff --git a/libsolidity/ast/ExperimentalFeatures.h b/libsolidity/ast/ExperimentalFeatures.h index b0a07142..2338b881 100644 --- a/libsolidity/ast/ExperimentalFeatures.h +++ b/libsolidity/ast/ExperimentalFeatures.h @@ -27,9 +27,13 @@ namespace dev namespace solidity { -enum class ExperimentalFeature {}; +enum class ExperimentalFeature { + Test +}; -static const std::map<std::string, ExperimentalFeature> ExperimentalFeatureNames = {}; +static const std::map<std::string, ExperimentalFeature> ExperimentalFeatureNames = { + { "__test", ExperimentalFeature::Test }, +}; } } diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 55ce5f7b..74422db1 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -6584,15 +6584,15 @@ BOOST_AUTO_TEST_CASE(experimental_pragma) pragma experimental unsupportedName unsupportedName; )"; CHECK_ERROR(text, SyntaxError, "Stray arguments."); + text = R"( + pragma experimental __test; + )"; + CHECK_WARNING(text, "Experimental features are turned on. Do not use experimental features on live deployments."); // text = R"( -// pragma experimental supportedName; -// )"; -// CHECK_WARNING(text, "Experimental features are turned on. Do not use experimental features on live deployments."); -// text = R"( -// pragma experimental supportedName; -// pragma experimental supportedName; +// pragma experimental __test; +// pragma experimental __test; // )"; -// CHECK_ERROR(text, SyntaxError, "Duplicate experimental feature name."); +// CHECK_ERROR_ALLOW_MULTI(text, SyntaxError, "Duplicate experimental feature name."); } BOOST_AUTO_TEST_SUITE_END() |