### 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.
Variant index_value = make_expression_reduced_value(p_subscript->index, is_index_value_reduced);
		if (!is_index_value_reduced) {
			return Variant();
		}
		bool is_valid = false;
		Variant value = base_value.get(index_value, &is_valid);
		if (is_valid) {
			is_reduced = true;
			return value;
		} else {
			return Variant();
		}
	}
}
Array GDScriptAnalyzer::make_array_from_element_datatype(const GDScriptParser::DataType &p_element_datatype, const GDScriptParser::Node *p_source_node) {
	Array array;
	Ref<Script> script_type = p_element_datatype.script_type;
	if (p_element_datatype.kind == GDScriptParser::DataType::CLASS && script_type.is_null()) {
		Error err = OK;
		Ref<GDScript> scr = GDScriptCache::get_shallow_script(p_element_datatype.script_path, err);
		if (err) {
			push_error(vformat(R"(Error while getting cache for script "%s".)", p_element_datatype.script_path), p_source_node);
			return array;
		}
		script_type.reference_ptr(scr->find_class(p_element_datatype.class_type->fqcn));
	}
	array.set_typed(p_element_datatype.builtin_type, p_element_datatype.native_type, script_type);
	return array;
}
Variant GDScriptAnalyzer::make_variable_default_value(GDScriptParser::VariableNode *p_variable) {