### 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 (is_type_compatible(this_element_type, element_type, false)) {
							
							element_type = this_element_type;
						} else {
							
							all_same_type = false;
							break;
						}
					}
				}
			}
		}
		if (all_same_type) {
			element_type.is_constant = false;
			array_type.set_container_element_type(element_type);
		} else if (all_have_type) {
			push_error(vformat(R"(Variant array is not compatible with an array of type "%s".)", p_base_type.get_container_element_type().to_string()), p_array_literal);
		}
	}
	
	p_array_literal->set_datatype(array_type);
}
void GDScriptAnalyzer::reduce_assignment(GDScriptParser::AssignmentNode *p_assignment) {
	reduce_expression(p_assignment->assignee);
	reduce_expression(p_assignment->assigned_value);
	if (p_assignment->assigned_value == nullptr || p_assignment->assignee == nullptr) {
		return;
	}
	GDScriptParser::DataType assignee_type = p_assignment->assignee->get_datatype();
	if (assignee_type.is_constant || (p_assignment->assignee->type == GDScriptParser::Node::SUBSCRIPT && static_cast<GDScriptParser::SubscriptNode *>(p_assignment->assignee)->base->is_constant)) {