summaryrefslogtreecommitdiff
path: root/compiler/cpp/src/thrift/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/cpp/src/thrift/main.cc')
-rw-r--r--compiler/cpp/src/thrift/main.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/cpp/src/thrift/main.cc b/compiler/cpp/src/thrift/main.cc
index c5aa65f32..a07f4295a 100644
--- a/compiler/cpp/src/thrift/main.cc
+++ b/compiler/cpp/src/thrift/main.cc
@@ -738,6 +738,12 @@ void validate_const_rec(std::string name, t_type* type, t_const_value* value) {
throw "type error: const \"" + name + "\" was declared as string";
}
break;
+ case t_base_type::TYPE_UUID:
+ if (value->get_type() != t_const_value::CV_STRING) {
+ throw "type error: const \"" + name + "\" was declared as uuid";
+ }
+ value->get_uuid(); // validates constant
+ break;
case t_base_type::TYPE_BOOL:
if (value->get_type() != t_const_value::CV_INTEGER) {
throw "type error: const \"" + name + "\" was declared as bool";