### Godot version

4.0 Beta 11 to 13

### System information

Windows 10

### Issue description

When trying to upgrade from Beta 10 one of my projects would immediately crash when opening the editor, with no error in the console which also crashed. I managed to isolate it to this enum:

```
enum { # Directions, clockwise, powers of 100, each direction gets 2 digits, allowing 100 terrains
	CENTER = 01,
	NORTH = 0100, # -Z
	NORTH_EAST = 010000,
	EAST = 01000000, # +X
	SOUTH_EAST = 0100000000,
	SOUTH = 010000000000, # +Z
	SOUTH_WEST = 01000000000000,
	WEST = 0100000000000000, # -X
	NORTH_WEST = 010000000000000000,
	ALL = 010101010101010101,
	ALL_CORNERS = NORTH_EAST + SOUTH_EAST + SOUTH_WEST + NORTH_WEST,
}
```

With this last line causing the crash:
`ALL_CORNERS = NORTH_EAST + SOUTH_EAST + SOUTH_WEST + NORTH_WEST,`

This worked in all the betas I've used up to and including Beta 10


### Steps to reproduce

Copy and paste that enum into a script, and save. Simply having a script with this enum will cause the editor to crash, the script doesn't need to be used anywhere.

### Minimal reproduction project

N/A
if (declared_return.kind != GDScriptParser::DataType::BUILTIN || declared_return.builtin_type != Variant::NIL) {
				push_error("Constructor cannot have an explicit return type.", p_function->return_type);
			}
		}
	} else {
		if (p_function->return_type != nullptr) {
			p_function->set_datatype(type_from_metatype(resolve_datatype(p_function->return_type)));
		} else {
			
			
			GDScriptParser::DataType return_type;
			return_type.type_source = GDScriptParser::DataType::INFERRED;
			return_type.kind = GDScriptParser::DataType::VARIANT;
			p_function->set_datatype(return_type);
		}
#ifdef TOOLS_ENABLED
		
		
		GDScriptParser::DataType base_type = parser->current_class->base_type;
		GDScriptParser::DataType parent_return_type;
		List<GDScriptParser::DataType> parameters_types;
		int default_par_count = 0;
		bool is_static = false;
		bool is_vararg = false;
		if (!p_is_lambda && get_function_signature(p_function, false, base_type, function_name, parent_return_type, parameters_types, default_par_count, is_static, is_vararg)) {
			bool valid = p_function->is_static == is_static;
			valid = valid && parent_return_type == p_function->get_datatype();
			int par_count_diff = p_function->parameters.size() - parameters_types.size();
			valid = valid && par_count_diff >= 0;
			valid = valid && default_value_count >= default_par_count + par_count_diff;