mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Warn if using experimental pragma
This commit is contained in:
parent
fbcc5f4ee5
commit
e44da40835
@ -77,6 +77,7 @@ bool SyntaxChecker::visit(PragmaDirective const& _pragma)
|
|||||||
"At least one experimental feature or the wildcard symbol \"*\" is required."
|
"At least one experimental feature or the wildcard symbol \"*\" is required."
|
||||||
);
|
);
|
||||||
else
|
else
|
||||||
|
{
|
||||||
for (string const literal: literals)
|
for (string const literal: literals)
|
||||||
{
|
{
|
||||||
if (literal.empty())
|
if (literal.empty())
|
||||||
@ -84,7 +85,11 @@ bool SyntaxChecker::visit(PragmaDirective const& _pragma)
|
|||||||
else if (m_sourceUnit->annotation().experimentalFeatures.count(literal))
|
else if (m_sourceUnit->annotation().experimentalFeatures.count(literal))
|
||||||
m_errorReporter.syntaxError(_pragma.location(), "Duplicate experimental feature name.");
|
m_errorReporter.syntaxError(_pragma.location(), "Duplicate experimental feature name.");
|
||||||
else
|
else
|
||||||
|
{
|
||||||
m_sourceUnit->annotation().experimentalFeatures.insert(literal);
|
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")
|
else if (_pragma.literals()[0] == "solidity")
|
||||||
|
Loading…
Reference in New Issue
Block a user