Warn if using experimental pragma

This commit is contained in:
Alex Beregszaszi 2017-08-02 20:05:35 +01:00
parent fbcc5f4ee5
commit e44da40835

View File

@ -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,7 +85,11 @@ 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")