aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
authorRhett Aultman <roadriverrail@gmail.com>2016-11-15 04:41:58 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2016-11-15 04:41:58 +0800
commit58e75c7a48f8166cca41e9017dad351113952ab5 (patch)
treeae7af869a4c5b1be6ee9272c01de855e0dbeb7c3 /libsolidity/interface
parent3f74c3c2369e59cb480cafdb31eeab6c18011504 (diff)
downloaddexon-solidity-58e75c7a48f8166cca41e9017dad351113952ab5.tar.gz
dexon-solidity-58e75c7a48f8166cca41e9017dad351113952ab5.tar.zst
dexon-solidity-58e75c7a48f8166cca41e9017dad351113952ab5.zip
Unimplemented features moved to their own exception (#1361)
Unimplemented features moved to their own exception InternalCompilerError is an exception that really should be reserved for actual internal errors of the compiler. Unimplemented features can now use either solUnimplemented( ) or, if it should be conditional, then solUnimplementedAssert( ). * Revert some unimplemented exceptions, add handlers The jsonCompiler and CommandLineInterface needed handlers for the new UnimplementedFeatureException, and some cases I had moved on to the new exception were better treated as real internal compiler errors. * Standardize on "Unimplemented feature" message
Diffstat (limited to 'libsolidity/interface')
-rw-r--r--libsolidity/interface/Exceptions.h1
-rw-r--r--libsolidity/interface/Utils.h6
2 files changed, 7 insertions, 0 deletions
diff --git a/libsolidity/interface/Exceptions.h b/libsolidity/interface/Exceptions.h
index 07835320..c651548a 100644
--- a/libsolidity/interface/Exceptions.h
+++ b/libsolidity/interface/Exceptions.h
@@ -37,6 +37,7 @@ using ErrorList = std::vector<std::shared_ptr<Error const>>;
struct CompilerError: virtual Exception {};
struct InternalCompilerError: virtual Exception {};
struct FatalError: virtual Exception {};
+struct UnimplementedFeatureError: virtual Exception{};
class Error: virtual public Exception
{
diff --git a/libsolidity/interface/Utils.h b/libsolidity/interface/Utils.h
index 738669ac..eef8c917 100644
--- a/libsolidity/interface/Utils.h
+++ b/libsolidity/interface/Utils.h
@@ -30,6 +30,7 @@ namespace dev
namespace solidity
{
struct InternalCompilerError;
+struct UnimplementedFeatureError;
}
}
@@ -37,3 +38,8 @@ struct InternalCompilerError;
#define solAssert(CONDITION, DESCRIPTION) \
assertThrow(CONDITION, ::dev::solidity::InternalCompilerError, DESCRIPTION)
+#define solUnimplementedAssert(CONDITION, DESCRIPTION) \
+ assertThrow(CONDITION, ::dev::solidity::UnimplementedFeatureError, DESCRIPTION)
+
+#define solUnimplemented(DESCRIPTION) \
+ solUnimplementedAssert(false, DESCRIPTION)