### Godot version

Beta 17, master

### System information

Windows 11

### Issue description

Godot gets a hard crash while attempting to code-complete for member `const` of a class.

### Steps to reproduce

```GDScript
enum E { V1 }

const e := E
```

And then type a `.` after the last `E`, which triggers code hints/auto-completion for subscripts based on `E` and causes a hard crash.

Does not happen for `var e := E.V1`.

### Minimal reproduction project

See above.
if (current_enum) {
		for (int i = 0; i < current_enum->values.size(); i++) {
			const GDScriptParser::EnumNode::Value &element = current_enum->values[i];
			if (element.identifier->name == p_identifier->name) {
				StringName enum_name = current_enum->identifier ? current_enum->identifier->name : UNNAMED_ENUM;
				GDScriptParser::DataType type = make_enum_type(enum_name, parser->current_class->fqcn, false);
				if (element.parent_enum->identifier) {
					type.enum_type = element.parent_enum->identifier->name;
				}
				p_identifier->set_datatype(type);
				if (element.resolved) {
					p_identifier->is_constant = true;
					p_identifier->reduced_value = element.value;
				} else {
					push_error(R"(Cannot use another enum element before it was declared.)", p_identifier);
				}
				return; 
			}
		}
	}
	bool found_source = false;
	
	
	switch (p_identifier->source) {
		case GDScriptParser::IdentifierNode::FUNCTION_PARAMETER:
			p_identifier->set_datatype(p_identifier->parameter_source->get_datatype());
			found_source = true;
			break;