### Godot version

v4.0.beta.custom_build [1d14c054a]

### System information

Kubuntu 22.10

### Issue description

Regression in master (in beta 10 the following script works correctly).

### Steps to reproduce

```gdscript
@tool
extends EditorScript

func wait(time: float) -> void:
    await get_editor_interface().get_tree().create_timer(time).timeout

func _run() -> void:
    reference()
    # Error: Cannot get return value of call to "wait()" because it returns "void".
    await wait(1.0)
    print("Test")
    unreference()
```

### Minimal reproduction project

N/A
} else {
			signature += "::" + String(func_name);
		}
		if (p_for_lambda) {
			signature += "(lambda)";
		}
		codegen.generator->set_signature(signature);
	}
#endif
	if (p_func) {
		codegen.generator->set_initial_line(p_func->start_line);
#ifdef TOOLS_ENABLED
		if (!p_for_lambda) {
			p_script->member_lines[func_name] = p_func->start_line;
			p_script->doc_functions[func_name] = p_func->doc_description;
		}
#endif
	} else {
		codegen.generator->set_initial_line(0);
	}
	GDScriptFunction *gd_function = codegen.generator->write_end();
	if (is_initializer) {
		p_script->initializer = gd_function;
	} else if (is_implicit_initializer) {
		p_script->implicit_initializer = gd_function;
	} else if (is_implicit_ready) {
		p_script->implicit_ready = gd_function;
	}
	if (p_func) {