Тип возврата выведен неправильно - PullRequest
0 голосов
/ 23 марта 2020

выпуск

import { Util, Tree, Database, Client } from 'abyssal-tree';

export default class UtilStuff extends Util {
    private readonly currentTree: Tree;

    public constructor(config: {
        tree: Tree;
        branchID: string | false;
        event: symbol | string;
        args: any[];
        session: string;
        database: Database;
        client: Client;
        execBranch: (id: string, util: Util) => Promise<void>;
    }, private readonly enableDebug?: boolean) {
        super(config, enableDebug);
        this.currentTree = config.tree;
    }

    public execBranch(branchID: string) {
        this.enableDebug && console.log(`Util --> Execute Branch [ Tree: ${this.treeID}, Branch: ${this.branchID}, Session: ${this.session} ]`);
        this.branchID = branchID;
        return this.currentTree.execBranch(branchID, this);
    }
}

error

I считаю , что эта ошибка неверна в качестве возврата тип this.currentTree.execBranch равен Promise<void>, но тип выводится как any.

Return Type

Используемая среда

abyssal-tree это локальный модуль, построенный из этого репозитория Github. Используя npm link, он связан с другим проектом со следующими package.json,

{
    "name": "Abyssal-Test",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
        "start": "tsc && node ./build/index.js",
        "build": "tsc"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "dependencies": {
        "@types/node": "^13.9.3",
        "@types/ws": "^7.2.3",
        "@typescript-eslint/eslint-plugin": "^2.25.0",
        "@typescript-eslint/parser": "^2.25.0",
        "discord.js": "^12.0.2",
        "eslint": "^6.8.0",
        "eslint-config-marine": "^6.0.0",
        "typescript": "^3.8.3"
    }
}

. index.ts - это код, отправленный в Issue . tsconfig.json является значением по умолчанию.

TS C Версия - 3.8.3

Editor Used

System Information

Попытки

Попытка перезагрузки ноутбука, обновление и переустановка всех узловых модулей обоих проектов, восстановление репозитория, попытка сборки с проектом с проблемой --clean.

...