- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.1k
Closed
Description
TypeScript Version: 3.7.0-dev.20191017
Search Terms:
No overload matches this call.
Code
class Repo {
    async getLastFetched(): Promise<number> {
        try {
            return await new Date().getTime();
        }
        catch {
            return 0;
        }
    }
    async getStatus(): Promise<{ status: number } | undefined> {
        return await { status: 0 };
    }
}
class Foo {
    private async getSingleRepoConfirmStep(repos: Repo[]) {
        const repo = repos[0];
        const [status, lastFetched] = await Promise.all([repo.getStatus(), repo.getLastFetched()]);
        let fetchedOn = ''
        if (lastFetched !== 0 && status !== undefined) {
            const goo = `${status.status}`;
            fetchedOn = `Last fetched ${new Date(lastFetched)}`;
        }
    }
}Expected behavior:
lastFetched is of type number
Actual behavior:
lastFetched is of type number | undefined
Related Issues:
Metadata
Metadata
Assignees
Labels
No labels