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

mark_node_unsafe(p_binary_op);
	} else {
		if (p_binary_op->variant_op < Variant::OP_MAX) {
			bool valid = false;
			result = get_operation_type(p_binary_op->variant_op, left_type, right_type, valid, p_binary_op);
			if (!valid) {
				push_error(vformat(R"(Invalid operands "%s" and "%s" for "%s" operator.)", left_type.to_string(), right_type.to_string(), Variant::get_operator_name(p_binary_op->variant_op)), p_binary_op);
			}
		} else {
			if (p_binary_op->operation == GDScriptParser::BinaryOpNode::OP_TYPE_TEST) {
				GDScriptParser::DataType test_type = right_type;
				test_type.is_meta_type = false;
				if (!is_type_compatible(test_type, left_type, false)) {
					
					if (!is_type_compatible(left_type, test_type, false)) {
						if (left_type.is_hard_type()) {
							push_error(vformat(R"(Expression is of type "%s" so it can't be of type "%s".)", left_type.to_string(), test_type.to_string()), p_binary_op->left_operand);
						} else {
							
							mark_node_unsafe(p_binary_op);
						}
					}
				}
				
				result.type_source = GDScriptParser::DataType::ANNOTATED_EXPLICIT;
				result.kind = GDScriptParser::DataType::BUILTIN;
				result.builtin_type = Variant::BOOL;
			} else {
				ERR_PRINT("Parser bug: unknown binary operation.");
			}