### 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)

current_suite = previous_suite;
	function->body = parse_suite("function declaration", body);
	current_function = previous_function;
	complete_extents(function);
	return function;
}
GDScriptParser::AnnotationNode *GDScriptParser::parse_annotation(uint32_t p_valid_targets) {
	AnnotationNode *annotation = alloc_node<AnnotationNode>();
	annotation->name = previous.literal;
	make_completion_context(COMPLETION_ANNOTATION, annotation);
	bool valid = true;
	if (!valid_annotations.has(annotation->name)) {
		push_error(vformat(R"(Unrecognized annotation: "%s".)", annotation->name));
		valid = false;
	}
	annotation->info = &valid_annotations[annotation->name];
	if (!annotation->applies_to(p_valid_targets)) {
		if (annotation->applies_to(AnnotationInfo::SCRIPT)) {
			push_error(vformat(R"(Annotation "%s" must be at the top of the script, before "extends" and "class_name".)", annotation->name));
		} else {
			push_error(vformat(R"(Annotation "%s" is not allowed in this level.)", annotation->name));
		}
		valid = false;
	}
	if (match(GDScriptTokenizer::Token::PARENTHESIS_OPEN)) {
		
		push_completion_call(annotation);
		make_completion_context(COMPLETION_ANNOTATION_ARGUMENTS, annotation, 0, true);
		if (!check(GDScriptTokenizer::Token::PARENTHESIS_CLOSE) && !is_at_end()) {
			push_multiline(true);