From ac7c6ae7d240516b0c530d51645742320634430d Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Wed, 7 Sep 2016 20:16:46 +0200 Subject: toFormalType reports errors by an exception This allows error reporting without passing `ASTNode` to `toFormalType()` --- libsolidity/formal/Why3Translator.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libsolidity/formal/Why3Translator.h') diff --git a/libsolidity/formal/Why3Translator.h b/libsolidity/formal/Why3Translator.h index 1b80ed61..22bfff89 100644 --- a/libsolidity/formal/Why3Translator.h +++ b/libsolidity/formal/Why3Translator.h @@ -60,9 +60,10 @@ private: /// Appends imports and constants use throughout the formal code. void appendPreface(); - /// @returns a string representation of the corresponding formal type or the empty string - /// if the type is not supported. + /// @returns a string representation of the corresponding formal type or throws NoFormalType exception. std::string toFormalType(Type const& _type) const; + using errinfo_noFormalTypeFrom = boost::error_info; + struct NoFormalType: virtual Exception {}; void indent() { newLine(); m_lines.back().indentation++; } void unindent(); -- cgit v1.2.3