### 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
.replace(": Array[String]", "")
									 .replace(": Node", "")
									 .replace(": CharFXTransform", "")
									 .replace(":=", "=")
									 .replace(" -> void", "")
									 .replace(" -> bool", "")
									 .replace(" -> int", "")
									 .replace(" -> PortType", "")
									 .replace(" -> String", "")
									 .replace(" -> Object", "");
	}
	processed_template = processed_template.replace("_BASE_", p_base_class_name)
								 .replace("_CLASS_SNAKE_CASE_", p_class_name.to_snake_case().validate_identifier())
								 .replace("_CLASS_", p_class_name.to_pascal_case().validate_identifier())
								 .replace("_TS_", _get_indentation());
	scr->set_source_code(processed_template);
	return scr;
}
Vector<ScriptLanguage::ScriptTemplate> GDScriptLanguage::get_built_in_templates(StringName p_object) {
	Vector<ScriptLanguage::ScriptTemplate> templates;
#ifdef TOOLS_ENABLED
	for (int i = 0; i < TEMPLATES_ARRAY_SIZE; i++) {
		if (TEMPLATES[i].inherit == p_object) {
			templates.append(TEMPLATES[i]);
		}
	}
#endif
	return templates;
}
static void get_function_names_recursively(const GDScriptParser::ClassNode *p_class, const String &p_prefix, HashMap<int, String> &r_funcs) {