### Godot version

v4.0custom_build[fcba87e]

### System information

Windows 10

### Issue description

Error when trying to call a method with a ternary operator.

### Steps to reproduce

```
extends Node

func _ready() -> void:
	test() if true else test()

func test() -> void:
	pass
```
[fcba87e](https://github.com/godotengine/godot/commit/fcba87e696d58912838d8a4a6987b10efa28e78f) - `Line 4:Cannot get return value of call to "test()" because it returns "void".`

v4.0beta10 - works fine

### Minimal reproduction project

[ternary_bug.zip](https://github.com/godotengine/godot/files/10368477/ternary_bug.zip)

for (int i = 0; i < p_suite->statements.size(); i++) {
		GDScriptParser::Node *stmt = p_suite->statements[i];
		for (GDScriptParser::AnnotationNode *&annotation : stmt->annotations) {
			annotation->apply(parser, stmt);
		}
#ifdef DEBUG_ENABLED
		HashSet<uint32_t> previously_ignored = parser->ignored_warning_codes;
		for (uint32_t ignored_warning : stmt->ignored_warnings) {
			parser->ignored_warning_codes.insert(ignored_warning);
		}
#endif 
		resolve_node(stmt);
#ifdef DEBUG_ENABLED
		parser->ignored_warning_codes = previously_ignored;
#endif 
		decide_suite_type(p_suite, stmt);
	}
}
void GDScriptAnalyzer::resolve_assignable(GDScriptParser::AssignableNode *p_assignable, const char *p_kind) {
	GDScriptParser::DataType type;
	type.kind = GDScriptParser::DataType::VARIANT;
	bool is_constant = p_assignable->type == GDScriptParser::Node::CONSTANT;
	GDScriptParser::DataType specified_type;
	bool has_specified_type = p_assignable->datatype_specifier != nullptr;
	if (has_specified_type) {
		specified_type = type_from_metatype(resolve_datatype(p_assignable->datatype_specifier));
		type = specified_type;
	}
	if (p_assignable->initializer != nullptr) {