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

ERR_FAIL_NULL(p_identifier);
	p_identifier->set_datatype(p_identifier_datatype);
	Error err = OK;
	GDScript *scr = GDScriptCache::get_full_script(p_identifier_datatype.script_path, err).ptr();
	ERR_FAIL_COND_MSG(err != OK, "Error while getting full script.");
	scr = scr->find_class(p_identifier_datatype.class_type->fqcn);
	p_identifier->reduced_value = scr;
	p_identifier->is_constant = true;
}
void GDScriptAnalyzer::reduce_identifier_from_base(GDScriptParser::IdentifierNode *p_identifier, GDScriptParser::DataType *p_base) {