diff options
Merge remote-tracking branch 'orig/develop' into hot_gav
Diffstat (limited to 'libsolidity/analysis/ReferencesResolver.h')
-rw-r--r-- | libsolidity/analysis/ReferencesResolver.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.h b/libsolidity/analysis/ReferencesResolver.h index 4276adaa..21cb1d35 100644 --- a/libsolidity/analysis/ReferencesResolver.h +++ b/libsolidity/analysis/ReferencesResolver.h @@ -43,12 +43,21 @@ class ReferencesResolver: private ASTConstVisitor { public: ReferencesResolver( - ASTNode& _root, + ErrorList& _errors, NameAndTypeResolver& _resolver, ContractDefinition const* _currentContract, ParameterList const* _returnParameters, bool _resolveInsideCode = false - ); + ): + m_errors(_errors), + m_resolver(_resolver), + m_currentContract(_currentContract), + m_returnParameters(_returnParameters), + m_resolveInsideCode(_resolveInsideCode) + {} + + /// @returns true if no errors during resolving + bool resolve(ASTNode& _root); private: virtual bool visit(Block const&) override { return m_resolveInsideCode; } @@ -59,10 +68,24 @@ private: TypePointer typeFor(TypeName const& _typeName); + /// Adds a new error to the list of errors. + void typeError(SourceLocation const& _location, std::string const& _description); + + /// Adds a new error to the list of errors and throws to abort type checking. + void fatalTypeError(SourceLocation const& _location, std::string const& _description); + + /// Adds a new error to the list of errors. + void declarationError(const SourceLocation& _location, std::string const& _description); + + /// Adds a new error to the list of errors and throws to abort type checking. + void fatalDeclarationError(const SourceLocation& _location, std::string const& _description); + + ErrorList& m_errors; NameAndTypeResolver& m_resolver; ContractDefinition const* m_currentContract; ParameterList const* m_returnParameters; - bool m_resolveInsideCode; + bool const m_resolveInsideCode; + bool m_errorOccurred = false; }; } |