### Godot version

4.0 beta 10

### System information

Windows 10

### Issue description

Godot crashes when i accidently name 2 items in an enum the same

EDIT:
The editor freeze for some seconds, then both editor- and console-window dissapear

### Steps to reproduce

Write

```gdscript
enum {
    A,
}
```

and then add a second line with another A:

```gdscript
enum {
    A,
    A # <- crash
}
```

Does not always immediatly happen if i copy&paste items.
Does not happen when i change the script in another editor and open the script in Godot.

### Minimal reproduction project

[enum.zip](https://github.com/godotengine/godot/files/10313759/enum.zip)

GDScriptParser::DataType array_type = p_array_literal->get_datatype();
	if (p_array_literal->elements.size() == 0) {
		
		array_type.set_container_element_type(p_base_type.get_container_element_type());
	} else {
		
		bool all_same_type = true;
		bool all_have_type = true;
		GDScriptParser::DataType element_type;
		for (int i = 0; i < p_array_literal->elements.size(); i++) {
			if (i == 0) {
				element_type = p_array_literal->elements[0]->get_datatype();
			} else {
				GDScriptParser::DataType this_element_type = p_array_literal->elements[i]->get_datatype();
				if (this_element_type.has_no_type()) {
					all_same_type = false;
					all_have_type = false;
					break;
				} else if (element_type != this_element_type) {
					if (!is_type_compatible(element_type, this_element_type, false)) {