diff --git a/libsolidity/Exceptions.h b/libsolidity/Exceptions.h index 723475c7252b..5a1b827c7e3d 100644 --- a/libsolidity/Exceptions.h +++ b/libsolidity/Exceptions.h @@ -41,6 +41,7 @@ class Error: virtual public Exception DocstringParsingError, ParserError, TypeError, + Warning }; @@ -69,7 +70,7 @@ class Error: virtual public Exception } } - Type type() { return m_type; } + Type const type() { return m_type; } const std::string const& typeName() const { return m_typeName; } private: diff --git a/libsolidity/TypeChecker.cpp b/libsolidity/TypeChecker.cpp index 658e48747e7c..e32644290ed1 100644 --- a/libsolidity/TypeChecker.cpp +++ b/libsolidity/TypeChecker.cpp @@ -45,11 +45,14 @@ bool TypeChecker::checkTypeRequirements(const ContractDefinition& _contract) } bool success = true; for (auto const& it: m_errors) - if (!dynamic_cast(it.get())) + { + Error const& e = dynamic_cast(it.get()); + if (e.type() != Error::Type::Warning) { success = false; break; } + } return success; } diff --git a/libsolidity/TypeChecker.h b/libsolidity/TypeChecker.h index cb65d5a8aa56..c654c698a31e 100644 --- a/libsolidity/TypeChecker.h +++ b/libsolidity/TypeChecker.h @@ -47,7 +47,7 @@ class TypeChecker: private ASTConstVisitor bool checkTypeRequirements(ContractDefinition const& _contract); /// @returns the list of errors and warnings found during type checking. - std::vector> const& errors() const { return m_errors; } + 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; @@ -114,7 +114,7 @@ class TypeChecker: private ASTConstVisitor /// Runs type checks on @a _expression to infer its type and then checks that it is an LValue. void requireLValue(Expression const& _expression); - std::vector> m_errors; + ErrorList m_errors; }; }