def fmt_type(data_type):
if is_struct_type(data_type) and data_type.has_enumerated_subtypes():<EOL><INDENT>possible_types = []<EOL>possible_subtypes = data_type.get_all_subtypes_with_tags()<EOL>for _, subtype in possible_subtypes:<EOL><INDENT>possible_types.append(fmt_type_name(subtype))<EOL><DEDENT>if data_type.is_catch_all():<EOL><INDENT>possible_types.append(fmt_type_name(data_type))<EOL><DEDENT>return fmt_jsdoc_union(possible_types)<EOL><DEDENT>else:<EOL><INDENT>return fmt_type_name(data_type)<EOL><DEDENT>
Returns a JSDoc annotation for a data type.
May contain a union of enumerated subtypes.