libsolidity: turns the var-keyword use from deprecation-warning to an error and include explicit type suggestion

This commit is contained in:
Christian Parpart 2018-06-11 14:06:56 +02:00 committed by Christian Parpart
parent 4649f9202a
commit 1486d215b9

View File

@ -262,14 +262,9 @@ bool SyntaxChecker::visit(FunctionTypeName const& _node)
bool SyntaxChecker::visit(VariableDeclaration const& _declaration)
{
bool const v050 = m_sourceUnit->annotation().experimentalFeatures.count(ExperimentalFeature::V050);
if (!_declaration.typeName())
{
if (v050)
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.");
m_errorReporter.syntaxError(_declaration.location(), "Use of the \"var\" keyword is disallowed.");
}
return true;
}