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

if (found) {
				break;
			}
			if (script_class->identifier && script_class->identifier->name == first) {
				result = script_class->get_datatype();
				break;
			}
			if (script_class->members_indices.has(first)) {
				resolve_class_member(script_class, first, p_type);
				GDScriptParser::ClassNode::Member member = script_class->get_member(first);
				switch (member.type) {
					case GDScriptParser::ClassNode::Member::CLASS:
						result = member.get_datatype();
						found = true;
						break;
					case GDScriptParser::ClassNode::Member::ENUM:
						result = member.get_datatype();
						found = true;
						break;
					case GDScriptParser::ClassNode::Member::CONSTANT:
						if (member.get_datatype().is_meta_type) {
							result = member.get_datatype();
							found = true;
							break;
						} else if (Ref<Script>(member.constant->initializer->reduced_value).is_valid()) {
							Ref<GDScript> gdscript = member.constant->initializer->reduced_value;
							if (gdscript.is_valid()) {
								Ref<GDScriptParserRef> ref = get_parser_for(gdscript->get_script_path());
								if (ref->raise_status(GDScriptParserRef::INHERITANCE_SOLVED) != OK) {
									push_error(vformat(R"(Could not parse script from "%s".)", gdscript->get_script_path()), p_type);