diff options
Diffstat (limited to 'buildscripts/idl/idl/enum_types.py')
-rw-r--r-- | buildscripts/idl/idl/enum_types.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/buildscripts/idl/idl/enum_types.py b/buildscripts/idl/idl/enum_types.py index 4098968ea10..c697cd775e4 100644 --- a/buildscripts/idl/idl/enum_types.py +++ b/buildscripts/idl/idl/enum_types.py @@ -188,6 +188,10 @@ class EnumTypeInfoBase(object, metaclass=ABCMeta): # One or more enums does not have associated extra data. indented_writer.write_line('default: return BSONObj();') + if len(extra_values) == len(self._enum.values): + # All enum cases handled, the compiler should know this. + indented_writer.write_line('MONGO_UNREACHABLE;') + class _EnumTypeInt(EnumTypeInfoBase, metaclass=ABCMeta): """Type information for integer enumerations.""" |