### 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
}
				result = ref->get_parser()->head->get_datatype();
			} else {
				result.kind = GDScriptParser::DataType::SCRIPT;
				result.script_type = ResourceLoader::load(path, "Script");
				result.native_type = result.script_type->get_instance_base_type();
				result.script_path = path;
				result.is_constant = true;
				result.is_meta_type = false;
			}
		}
	} else if (ProjectSettings::get_singleton()->has_autoload(first) && ProjectSettings::get_singleton()->get_autoload(first).is_singleton) {
		const ProjectSettings::AutoloadInfo &autoload = ProjectSettings::get_singleton()->get_autoload(first);
		Ref<GDScriptParserRef> ref = get_parser_for(autoload.path);
		if (ref->raise_status(GDScriptParserRef::INHERITANCE_SOLVED) != OK) {
			push_error(vformat(R"(Could not parse singleton "%s" from "%s".)", first, autoload.path), p_type);
			return bad_type;
		}
		result = ref->get_parser()->head->get_datatype();
	} else if (ClassDB::has_enum(parser->current_class->base_type.native_type, first)) {
		
		result = make_native_enum_type(parser->current_class->base_type.native_type, first);
	} else {
		
		List<GDScriptParser::ClassNode *> script_classes;
		get_class_node_current_scope_classes(parser->current_class, &script_classes);
		for (GDScriptParser::ClassNode *script_class : script_classes) {
			if (script_class->identifier && script_class->identifier->name == first) {
				result = script_class->get_datatype();
				break;