### 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
GDScriptParser::DataType id_type;
	GDScriptParser::SuiteNode *suite = p_context.current_suite;
	bool is_function_parameter = false;
	bool can_be_local = true;
	switch (p_identifier->source) {
		case GDScriptParser::IdentifierNode::MEMBER_VARIABLE:
		case GDScriptParser::IdentifierNode::MEMBER_CONSTANT:
		case GDScriptParser::IdentifierNode::MEMBER_FUNCTION:
		case GDScriptParser::IdentifierNode::MEMBER_SIGNAL:
		case GDScriptParser::IdentifierNode::MEMBER_CLASS:
		case GDScriptParser::IdentifierNode::INHERITED_VARIABLE:
		case GDScriptParser::IdentifierNode::STATIC_VARIABLE:
			can_be_local = false;
			break;
		default:
			break;
	}
	if (can_be_local && suite && suite->has_local(p_identifier->name)) {
		const GDScriptParser::SuiteNode::Local &local = suite->get_local(p_identifier->name);
		id_type = local.get_datatype();
		
		switch (local.type) {
			case GDScriptParser::SuiteNode::Local::VARIABLE:
				if (local.variable->initializer) {
					last_assign_line = local.variable->initializer->end_line;
					last_assigned_expression = local.variable->initializer;
				}
				break;
			case GDScriptParser::SuiteNode::Local::CONSTANT:
				if (local.constant->initializer) {