Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LianaHus committed Oct 14, 2015
1 parent 742e5b2 commit 8f7f22c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion libsolidity/Exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Error: virtual public Exception
DocstringParsingError,
ParserError,
TypeError,

Warning
};

Expand Down Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion libsolidity/TypeChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ bool TypeChecker::checkTypeRequirements(const ContractDefinition& _contract)
}
bool success = true;
for (auto const& it: m_errors)
if (!dynamic_cast<Warning const*>(it.get()))
{
Error const& e = dynamic_cast<Error const&>(it.get());
if (e.type() != Error::Type::Warning)
{
success = false;
break;
}
}
return success;
}

Expand Down
4 changes: 2 additions & 2 deletions libsolidity/TypeChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::shared_ptr<Error const>> 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;
Expand Down Expand Up @@ -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<std::shared_ptr<Error const>> m_errors;
ErrorList m_errors;
};

}
Expand Down

0 comments on commit 8f7f22c

Please sign in to comment.