### 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.
bool all_is_constant = true;
					Vector<Variant> args;
					args.resize(call->arguments.size());
					for (int i = 0; i < call->arguments.size(); i++) {
						reduce_expression(call->arguments[i]);
						if (!call->arguments[i]->is_constant) {
							all_is_constant = false;
						} else if (all_is_constant) {
							args.write[i] = call->arguments[i]->reduced_value;
						}
						GDScriptParser::DataType arg_type = call->arguments[i]->get_datatype();
						if (!arg_type.is_variant()) {
							if (arg_type.kind != GDScriptParser::DataType::BUILTIN) {
								all_is_constant = false;
								push_error(vformat(R"*(Invalid argument for "range()" call. Argument %d should be int or float but "%s" was given.)*", i + 1, arg_type.to_string()), call->arguments[i]);
							} else if (arg_type.builtin_type != Variant::INT && arg_type.builtin_type != Variant::FLOAT) {
								all_is_constant = false;
								push_error(vformat(R"*(Invalid argument for "range()" call. Argument %d should be int or float but "%s" was given.)*", i + 1, arg_type.to_string()), call->arguments[i]);
							}
						}
					}
					Variant reduced;
					if (all_is_constant) {
						switch (args.size()) {
							case 1:
								reduced = (int32_t)args[0];
								break;
							case 2:
								reduced = Vector2i(args[0], args[1]);