microsoft/TypeScript

[NewErrors] 4.1.0-dev.20201101 vs 4.0.5

typescript-bot opened this issue · 2 comments

The following errors were reported by 4.1.0-dev.20201101, but not by 4.0.5

vscode

6 of 43 projects failed to build with the old tsc

test/smoke/tsconfig.json

puppeteer

4 of 8 projects failed to build with the old tsc

scripts/tsconfig.json

  • error TS2322: Type '(value: boolean | PromiseLike<boolean>) => void' is not assignable to type '() => void'.

tsconfig.json

  • error TS2322: Type '(value: boolean | PromiseLike<boolean>) => void' is not assignable to type '() => void'.

src/tsconfig.cjs.json

src/tsconfig.esm.json

hyper

1 of 2 projects failed to build with the old tsc

tsconfig.json

nativefier

tsconfig.json

  • error TS2794: Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'?

rxjs

7 of 11 projects failed to build with the old tsc

src/tsconfig.cjs.spec.json

  • error TS2322: Type '(value: T | PromiseLike<T>) => void' is not assignable to type '(value?: T | PromiseLike<T> | undefined) => void'.

src/tsconfig.esm5.rollup.json

  • error TS2322: Type '(value: T | PromiseLike<T>) => void' is not assignable to type '(value?: T | PromiseLike<T> | undefined) => void'.

react-navigation

packages/bottom-tabs/tsconfig.json

packages/compat/tsconfig.json

packages/drawer/tsconfig.json

packages/material-bottom-tabs/tsconfig.json

packages/material-top-tabs/tsconfig.json

packages/stack/tsconfig.json

tsconfig.json

playwright

3 of 4 projects failed to build with the old tsc

src/install/tsconfig.json

terminus

14 of 17 projects failed to build with the old tsc

terminus-core/tsconfig.typings.json

terminus-terminal/tsconfig.typings.json

tools

tsconfig.json

fingerprintjs

tsconfig.json

redux-devtools

9 of 50 projects failed to build with the old tsc

packages/react-json-tree/test/tsconfig.json

packages/react-json-tree/tsconfig.json

packages/redux-devtools-inspector-monitor/demo/tsconfig.json

packages/redux-devtools-inspector-monitor/tsconfig.json

packages/redux-devtools-inspector-monitor-trace-tab/test/tsconfig.json

packages/redux-devtools-inspector-monitor-trace-tab/tsconfig.json

packages/redux-devtools-cli/test/tsconfig.json

face-api.js

tsconfig.es6.json

tsconfig.json

tsconfig.test.json

Tone.js

scripts/tsconfig.build.json

tsconfig.json

I think I just ran into this, was about to enter a new Issue but the keyword search step helped me find this (kudos!):

4.1.0-dev.20201028 succeeds
4.1.0-dev.20201029 fails

import { promisify } from "util";

// These are components of @types/xml2js@0.4.5
export interface convertableToString {
    toString(): string;
}
declare class Parser {
    // `cb` isn't great, origin: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/87abb796d1ca0367185a86a580c8b5a5150296c8/types/xml2js/index.d.ts#L33
    parseString(str: convertableToString, cb?: Function): void;
}

const xmlParser = new Parser();
const parseString = xmlParser.parseString.bind(xmlParser);
const parseStringP = promisify(parseString);

// This errors in Nightly (v4.2.0-dev.20201103), succeeds in v4.1.0-beta
parseStringP("abc");

In the success case, this promisify overload is selected:

(alias) promisify<convertableToString, unknown>(fn: (arg1: convertableToString, callback: (err: any, result: unknown) => void) => void): (arg1: convertableToString) => Promise<...> (+13 overloads)

... resulting in a bad parseStringP signature.

In the fail:

(alias) promisify<unknown>(fn: (callback: (err: any, result: unknown) => void) => void): () => Promise<unknown> (+13 overloads)

Edit: I see the majority of these failures were already in #41235 and #41155 before that. I can open this as a standalone Issue if needed.

@tchetwin please open a fresh issue; thanks!