### 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::CompletionContext c = p_context;
		c.current_line = last_assign_line;
		r_type.assigned_expression = last_assigned_expression;
		if (_guess_expression_type(c, last_assigned_expression, r_type)) {
			return true;
		}
	}
	if (is_function_parameter && p_context.current_function && p_context.current_function->source_lambda == nullptr && p_context.current_class) {
		
		GDScriptParser::DataType base_type = p_context.current_class->base_type;
		while (base_type.is_set()) {
			switch (base_type.kind) {
				case GDScriptParser::DataType::CLASS:
					if (base_type.class_type->has_function(p_context.current_function->identifier->name)) {
						GDScriptParser::FunctionNode *parent_function = base_type.class_type->get_member(p_context.current_function->identifier->name).function;
						if (parent_function->parameters_indices.has(p_identifier->name)) {
							const GDScriptParser::ParameterNode *parameter = parent_function->parameters[parent_function->parameters_indices[p_identifier->name]];
							if ((!id_type.is_set() || id_type.is_variant()) && parameter->get_datatype().is_hard_type()) {
								id_type = parameter->get_datatype();
							}
							if (parameter->initializer) {
								GDScriptParser::CompletionContext c = p_context;
								c.current_function = parent_function;
								c.current_class = base_type.class_type;
								c.base = nullptr;
								if (_guess_expression_type(c, parameter->initializer, r_type)) {
									return true;
								}
							}
						}