### Godot version

Godot 4.0 RC 2

### System information

Windows 11

### Issue description

As the title states you get no autocompletion when statically typing.
Of course the code still works, but it shouldn't be neccessary to cast an object to a type it already is.

### Steps to reproduce

1. Create child class with some functionality
![image](https://user-images.githubusercontent.com/100119945/220173809-0b2b2788-d986-4fa7-815c-444268d09c32.png)

2. Get node in parent class and call childs function
![image](https://user-images.githubusercontent.com/100119945/220174167-5ff3c8e9-863e-4fbd-a3cf-d88d34597b39.png)



### Minimal reproduction project

N/A
const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\"";
	GDScriptParser parser;
	GDScriptAnalyzer analyzer(&parser);
	parser.parse(p_code, p_path, true);
	analyzer.analyze();
	r_forced = false;
	HashMap<String, ScriptLanguage::CodeCompletionOption> options;
	GDScriptParser::CompletionContext completion_context = parser.get_completion_context();
	completion_context.base = p_owner;
	bool is_function = false;
	switch (completion_context.type) {
		case GDScriptParser::COMPLETION_NONE:
			break;
		case GDScriptParser::COMPLETION_ANNOTATION: {
			List<MethodInfo> annotations;
			parser.get_annotation_list(&annotations);
			for (const MethodInfo &E : annotations) {
				ScriptLanguage::CodeCompletionOption option(E.name.substr(1), ScriptLanguage::CODE_COMPLETION_KIND_PLAIN_TEXT);
				if (E.arguments.size() > 0) {
					option.insert_text += "(";
				}
				options.insert(option.display, option);
			}
			r_forced = true;
		} break;
		case GDScriptParser::COMPLETION_ANNOTATION_ARGUMENTS: {
			if (completion_context.node == nullptr || completion_context.node->type != GDScriptParser::Node::ANNOTATION) {
				break;
			}