aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/TypeChecker.h
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/TypeChecker.h')
-rw-r--r--libsolidity/TypeChecker.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/libsolidity/TypeChecker.h b/libsolidity/TypeChecker.h
index c654c698..de095e3b 100644
--- a/libsolidity/TypeChecker.h
+++ b/libsolidity/TypeChecker.h
@@ -42,26 +42,26 @@ namespace solidity
class TypeChecker: private ASTConstVisitor
{
public:
+ /// @_errors the reference to the list of errors and warnings to add them found during type checking.
+ TypeChecker(ErrorList& _errors): m_errors(_errors) {}
+
/// 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
bool checkTypeRequirements(ContractDefinition const& _contract);
- /// @returns the list of errors and warnings found during type checking.
- ErrorList const& errors() const { return m_errors; }
-
/// @returns the type of an expression and asserts that it is present.
TypePointer const& type(Expression const& _expression) const;
/// @returns the type of the given variable and throws if the type is not present
/// (this can happen for variables with non-explicit types before their types are resolved)
TypePointer const& type(VariableDeclaration const& _variable) const;
+private:
/// Adds a new error to the list of errors.
void typeError(ASTNode const& _node, std::string const& _description);
/// Adds a new error to the list of errors and throws to abort type checking.
void fatalTypeError(ASTNode const& _node, std::string const& _description);
-private:
virtual bool visit(ContractDefinition const& _contract) override;
/// Checks that two functions defined in this contract with the same name have different
/// arguments and that there is at most one constructor.
@@ -114,7 +114,7 @@ private:
/// Runs type checks on @a _expression to infer its type and then checks that it is an LValue.
void requireLValue(Expression const& _expression);
- ErrorList m_errors;
+ ErrorList& m_errors;
};
}