diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-03 03:05:35 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-10 06:41:46 +0800 |
commit | e44da40835670e667eda0ca30467fa52328a9075 (patch) | |
tree | 02b4b745a75eb281996fc60d8ea16c8ef302730a /libsolidity | |
parent | fbcc5f4ee5bd629474047531f76beaa19c62972b (diff) | |
download | dexon-solidity-e44da40835670e667eda0ca30467fa52328a9075.tar.gz dexon-solidity-e44da40835670e667eda0ca30467fa52328a9075.tar.zst dexon-solidity-e44da40835670e667eda0ca30467fa52328a9075.zip |
Warn if using experimental pragma
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/SyntaxChecker.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp index 04c4e2d8..db3e0a7a 100644 --- a/libsolidity/analysis/SyntaxChecker.cpp +++ b/libsolidity/analysis/SyntaxChecker.cpp @@ -77,6 +77,7 @@ bool SyntaxChecker::visit(PragmaDirective const& _pragma) "At least one experimental feature or the wildcard symbol \"*\" is required." ); else + { for (string const literal: literals) { if (literal.empty()) @@ -84,8 +85,12 @@ bool SyntaxChecker::visit(PragmaDirective const& _pragma) else if (m_sourceUnit->annotation().experimentalFeatures.count(literal)) m_errorReporter.syntaxError(_pragma.location(), "Duplicate experimental feature name."); else + { m_sourceUnit->annotation().experimentalFeatures.insert(literal); + m_errorReporter.warning(_pragma.location(), "Experimental features are turned on. Do not use experimental features on live deployments."); + } } + } } else if (_pragma.literals()[0] == "solidity") { |