### 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 (p_for->list->datatype.has_container_element_type()) {
			variable_type = p_for->list->datatype.get_container_element_type();
			variable_type.type_source = GDScriptParser::DataType::ANNOTATED_INFERRED;
		} else if (p_for->list->datatype.is_typed_container_type()) {
			variable_type = p_for->list->datatype.get_typed_container_type();
			variable_type.type_source = GDScriptParser::DataType::ANNOTATED_INFERRED;
		} else {
			
			
			variable_type.type_source = GDScriptParser::DataType::UNDETECTED;
			variable_type.kind = GDScriptParser::DataType::VARIANT;
		}
	}
	if (p_for->variable) {
		p_for->variable->set_datatype(variable_type);
	}
	resolve_suite(p_for->loop);
	p_for->set_datatype(p_for->loop->get_datatype());
#ifdef DEBUG_ENABLED
	if (p_for->variable) {
		is_shadowing(p_for->variable, R"("for" iterator variable)");
	}
#endif
}
void GDScriptAnalyzer::resolve_while(GDScriptParser::WhileNode *p_while) {
	resolve_node(p_while->condition, false);
	resolve_suite(p_while->loop);
	p_while->set_datatype(p_while->loop->get_datatype());
}
void GDScriptAnalyzer::resolve_assert(GDScriptParser::AssertNode *p_assert) {