mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
libsolidity: turns the var-keyword use from deprecation-warning to an error and include explicit type suggestion
This commit is contained in:
parent
4649f9202a
commit
1486d215b9
@ -262,14 +262,9 @@ bool SyntaxChecker::visit(FunctionTypeName const& _node)
|
|||||||
|
|
||||||
bool SyntaxChecker::visit(VariableDeclaration const& _declaration)
|
bool SyntaxChecker::visit(VariableDeclaration const& _declaration)
|
||||||
{
|
{
|
||||||
bool const v050 = m_sourceUnit->annotation().experimentalFeatures.count(ExperimentalFeature::V050);
|
|
||||||
|
|
||||||
if (!_declaration.typeName())
|
if (!_declaration.typeName())
|
||||||
{
|
{
|
||||||
if (v050)
|
m_errorReporter.syntaxError(_declaration.location(), "Use of the \"var\" keyword is disallowed.");
|
||||||
m_errorReporter.syntaxError(_declaration.location(), "Use of the \"var\" keyword is deprecated.");
|
|
||||||
else
|
|
||||||
m_errorReporter.warning(_declaration.location(), "Use of the \"var\" keyword is deprecated.");
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user