### 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
} else {
			arghint += par->identifier->name.operator String() + ": " + par->get_datatype().to_string();
		}
		if (par->initializer) {
			String def_val = "<unknown>";
			switch (par->initializer->type) {
				case GDScriptParser::Node::LITERAL: {
					const GDScriptParser::LiteralNode *literal = static_cast<const GDScriptParser::LiteralNode *>(par->initializer);
					def_val = literal->value.get_construct_string();
				} break;
				case GDScriptParser::Node::IDENTIFIER: {
					const GDScriptParser::IdentifierNode *id = static_cast<const GDScriptParser::IdentifierNode *>(par->initializer);
					def_val = id->name.operator String();
				} break;
				case GDScriptParser::Node::CALL: {
					const GDScriptParser::CallNode *call = static_cast<const GDScriptParser::CallNode *>(par->initializer);
					if (call->is_constant && call->reduced) {
						def_val = call->function_name.operator String() + call->reduced_value.operator String();
					}
				} break;
				case GDScriptParser::Node::ARRAY: {
					const GDScriptParser::ArrayNode *arr = static_cast<const GDScriptParser::ArrayNode *>(par->initializer);
					if (arr->is_constant && arr->reduced) {
						def_val = arr->reduced_value.operator String();
					}
				} break;
				case GDScriptParser::Node::DICTIONARY: {
					const GDScriptParser::DictionaryNode *dict = static_cast<const GDScriptParser::DictionaryNode *>(par->initializer);
					if (dict->is_constant && dict->reduced) {
						def_val = dict->reduced_value.operator String();