### 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.
result = script_class->get_datatype();
				break;
			}
			if (script_class->members_indices.has(first)) {
				resolve_class_member(script_class, first, p_type);
				GDScriptParser::ClassNode::Member member = script_class->get_member(first);
				switch (member.type) {
					case GDScriptParser::ClassNode::Member::CLASS:
						result = member.get_datatype();
						found = true;
						break;
					case GDScriptParser::ClassNode::Member::ENUM:
						result = member.get_datatype();
						found = true;
						break;
					case GDScriptParser::ClassNode::Member::CONSTANT:
						if (member.get_datatype().is_meta_type) {
							result = member.get_datatype();
							found = true;
							break;
						} else if (Ref<Script>(member.constant->initializer->reduced_value).is_valid()) {
							Ref<GDScript> gdscript = member.constant->initializer->reduced_value;
							if (gdscript.is_valid()) {
								Ref<GDScriptParserRef> ref = get_parser_for(gdscript->get_script_path());
								if (ref->raise_status(GDScriptParserRef::INHERITANCE_SOLVED) != OK) {
									push_error(vformat(R"(Could not parse script from "%s".)", gdscript->get_script_path()), p_type);
									return bad_type;
								}
								result = ref->get_parser()->head->get_datatype();
							} else {