### 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)

Error err = resolve_class_inheritance(look_class, p_class);
							if (err) {
								return err;
							}
						}
						base = look_class->get_datatype();
						found = true;
						break;
					}
					if (look_class->has_member(name)) {
						resolve_class_member(look_class, name, p_class);
						base = look_class->get_member(name).get_datatype();
						found = true;
						break;
					}
				}
				if (!found) {
					push_error(vformat(R"(Could not find base class "%s".)", name), p_class);
					return ERR_PARSE_ERROR;
				}
			}
		}
		for (int index = extends_index; index < p_class->extends.size(); index++) {
			if (base.kind != GDScriptParser::DataType::CLASS) {
				push_error(R"(Super type "%s" is not a GDScript. Cannot get nested types.)", p_class);
				return ERR_PARSE_ERROR;
			}
			
			GDScriptParser::IdentifierNode *id = parser->alloc_node<GDScriptParser::IdentifierNode>();
			id->name = p_class->extends[index];