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

}
				if (colon_pos == stripped_line.length() || stripped_line[colon_pos++] != ':') {
					continue; 
				}
				title = stripped_line.substr(open_bracket_pos, close_bracket_pos - open_bracket_pos).strip_edges();
				link = stripped_line.substr(colon_pos).strip_edges();
			}
			mode = TUTORIALS;
			in_codeblock = false;
		} else if (stripped_line.is_empty()) {
			continue;
		} else {
			
			if (mode == TUTORIALS) {
				mode = DONE;
			}
			in_codeblock = _in_codeblock(doc_line, in_codeblock, &codeblock_begins);
		}
		if (in_codeblock) {
			int i = 0;
			for (; i < codeblock_begins; i++) {
				if (doc_line[i] != ' ') {
					break;
				}
			}
			doc_line = doc_line.substr(i);
		} else {
			doc_line = stripped_line;
		}
		String line_join = (in_codeblock) ? "\n" : " ";