diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-09-08 02:16:46 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2016-09-10 02:15:08 +0800 |
commit | ac7c6ae7d240516b0c530d51645742320634430d (patch) | |
tree | d42b7df48c2d03486dfe11864c29bbd6c1fc6023 /libsolidity/formal/Why3Translator.h | |
parent | c861cf579dc4c1303d6d215b5b31f930e1d6477e (diff) | |
download | dexon-solidity-ac7c6ae7d240516b0c530d51645742320634430d.tar.gz dexon-solidity-ac7c6ae7d240516b0c530d51645742320634430d.tar.zst dexon-solidity-ac7c6ae7d240516b0c530d51645742320634430d.zip |
toFormalType reports errors by an exception
This allows error reporting without passing `ASTNode` to `toFormalType()`
Diffstat (limited to 'libsolidity/formal/Why3Translator.h')
-rw-r--r-- | libsolidity/formal/Why3Translator.h | 5 |
1 files changed, 3 insertions, 2 deletions
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 tag_noFormalTypeFrom, std::string /* name of the type that cannot be translated */ >; + struct NoFormalType: virtual Exception {}; void indent() { newLine(); m_lines.back().indentation++; } void unindent(); |