Use EVM version in type checker.

This commit is contained in:
chriseth
2018-03-01 17:19:35 +01:00
parent f2f61f1c2f
commit a53d6b499d
5 changed files with 23 additions and 8 deletions
+8 -1
View File
@@ -22,6 +22,8 @@
#pragma once
#include <libsolidity/interface/EVMVersion.h>
#include <libsolidity/ast/Types.h>
#include <libsolidity/ast/ASTAnnotations.h>
#include <libsolidity/ast/ASTForward.h>
@@ -43,7 +45,10 @@ class TypeChecker: private ASTConstVisitor
{
public:
/// @param _errorReporter provides the error logging functionality.
TypeChecker(ErrorReporter& _errorReporter): m_errorReporter(_errorReporter) {}
TypeChecker(EVMVersion _evmVersion, ErrorReporter& _errorReporter):
m_evmVersion(_evmVersion),
m_errorReporter(_errorReporter)
{}
/// Performs type checking on the given contract and all of its sub-nodes.
/// @returns true iff all checks passed. Note even if all checks passed, errors() can still contain warnings
@@ -132,6 +137,8 @@ private:
ContractDefinition const* m_scope = nullptr;
EVMVersion m_evmVersion;
/// Flag indicating whether we are currently inside an EmitStatement.
bool m_insideEmitStatement = false;