### 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
}
									Callable::CallError ce;
									Variant ret = mb->call(baseptr, (const Variant **)argptr.ptr(), argptr.size(), ce);
									if (ce.error == Callable::CallError::CALL_OK && ret.get_type() != Variant::NIL) {
										if (ret.get_type() != Variant::OBJECT || ret.operator Object *() != nullptr) {
											r_type = _type_from_variant(ret);
											found = true;
										}
									}
								}
							}
						}
					}
					if (!found && base.value.get_type() != Variant::NIL) {
						found = _guess_method_return_type_from_base(c, base, call->function_name, r_type);
					}
				}
			} break;
			case GDScriptParser::Node::SUBSCRIPT: {
				const GDScriptParser::SubscriptNode *subscript = static_cast<const GDScriptParser::SubscriptNode *>(p_expression);
				if (subscript->is_attribute) {
					GDScriptParser::CompletionContext c = p_context;
					c.current_line = subscript->start_line;
					GDScriptCompletionIdentifier base;
					if (!_guess_expression_type(c, subscript->base, base)) {
						found = false;
						break;
					}
					if (base.value.get_type() == Variant::DICTIONARY && base.value.operator Dictionary().has(String(subscript->attribute->name))) {
						Variant value = base.value.operator Dictionary()[String(subscript->attribute->name)];