diff options
Diffstat (limited to 'libsolidity/analysis/SyntaxChecker.cpp')
-rw-r--r-- | libsolidity/analysis/SyntaxChecker.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp index b6cc04da..5a3745b0 100644 --- a/libsolidity/analysis/SyntaxChecker.cpp +++ b/libsolidity/analysis/SyntaxChecker.cpp @@ -224,3 +224,17 @@ bool SyntaxChecker::visit(FunctionTypeName const& _node) return true; } + +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."); + } + return true; +} |