Closed
Description
The following errors were reported by 4.5.0-dev.20210912, but not by 4.4.3
microsoft/vscode
2 of 51 projects failed to build with the old tsc
extensions/github/tsconfig.json
error TS2339: Property 'pulls' does not exist on type '({ [x: string]: any; } & { [x: string]: any; } & Octokit & void & { paginate: PaginateInterface; } & RestEndpointMethods) | ReposCreateForkResponseData'.
src/tsconfig.json
error TS2558: Expected 1 type arguments, but got 2.
error TS2322: Type 'IQuickPickSeparator | Awaited<T>' is not assignable to type 'T | undefined'.
error TS2322: Type 'IQuickPickSeparator | Awaited<T>' is not assignable to type 'readonly (IQuickPickSeparator | T)[]'.
error TS2339: Property 'filter' does not exist on type 'IQuickPickSeparator | Awaited<T>'.
error TS7006: Parameter 'item' implicitly has an 'any' type.
error TS2488: Type '{ name: string; cmd: string; pid: number; ppid: number; load: number; mem: number; children?: ProcessItem[] | undefined; }' must have a '[Symbol.iterator]()' method that returns an iterator.
src/tsconfig.monaco.json
error TS2558: Expected 1 type arguments, but got 2.
error TS2322: Type 'IQuickPickSeparator | Awaited<T>' is not assignable to type 'T | undefined'.
error TS2322: Type 'IQuickPickSeparator | Awaited<T>' is not assignable to type 'readonly (IQuickPickSeparator | T)[]'.
error TS2339: Property 'filter' does not exist on type 'IQuickPickSeparator | Awaited<T>'.
error TS7006: Parameter 'item' implicitly has an 'any' type.
src/tsconfig.tsec.json
error TS2558: Expected 1 type arguments, but got 2.
error TS2322: Type 'IQuickPickSeparator | Awaited<T>' is not assignable to type 'T | undefined'.
error TS2322: Type 'IQuickPickSeparator | Awaited<T>' is not assignable to type 'readonly (IQuickPickSeparator | T)[]'.
error TS2339: Property 'filter' does not exist on type 'IQuickPickSeparator | Awaited<T>'.
error TS7006: Parameter 'item' implicitly has an 'any' type.
error TS2488: Type '{ name: string; cmd: string; pid: number; ppid: number; load: number; mem: number; children?: ProcessItem[] | undefined; }' must have a '[Symbol.iterator]()' method that returns an iterator.
reduxjs/react-redux
test/typetests/tsconfig.json
error TS2322: Type 'Context<ReactReduxContextValue<any, AnyAction> | null> | MutableRefObject<unknown> | ((instance: unknown) => void) | Omit<...>' is not assignable to type 'Context<ReactReduxContextValue<any, AnyAction> | null>'.
error TS2339: Property 'Consumer' does not exist on type 'Context<ReactReduxContextValue<any, AnyAction> | null> | MutableRefObject<unknown> | ((instance: unknown) => void) | Omit<...>'.
tsconfig.json
error TS2322: Type 'Context<ReactReduxContextValue<any, AnyAction> | null> | MutableRefObject<unknown> | ((instance: unknown) => void) | Omit<...>' is not assignable to type 'Context<ReactReduxContextValue<any, AnyAction> | null>'.
error TS2339: Property 'Consumer' does not exist on type 'Context<ReactReduxContextValue<any, AnyAction> | null> | MutableRefObject<unknown> | ((instance: unknown) => void) | Omit<...>'.
youzan/vant
2 of 9 projects failed to build with the old tsc
packages/create-vant-cli-app/tsconfig.json
error TS2769: No overload matches this call.
error TS2345: Argument of type '{}' is not assignable to parameter of type 'string'.
lensapp/lens
4 of 5 projects failed to build with the old tsc
tsconfig.json
error TS2322: Type 'IMetrics | Awaited<T> | Awaited<{ [K in keyof T]: IMetrics; }>' is not assignable to type 'T extends object ? { [K in keyof T]: IMetrics; } : IMetrics'.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
andrewbranch commentedon Sep 13, 2021
Most of these are from #45350—@rbuckton, you’ll probably want to take a look at some of the assignability errors mentioning
Awaited
. There are a couple type argument issues but those seem trivial to fix. It’s more important to understand the others and see if they have easy fixes too.rbuckton commentedon Sep 16, 2021
Regarding extensions/github/src/pushErrorHandler.ts#L106: It looks like the call to
withProgress
at line 32 was previously returning a tuple type of[Octokit, ReposCreateForkResponseData]
, but is now returning(Octokit | ReposCreateForkResponseData)[]
. If we were previously inferring a tuple here, but aren't due to the change toawait
then that's definitely a bug.rbuckton commentedon Sep 16, 2021
It looks like extensions/github/src/pushErrorHandler.ts#L106 is due to #45719 since we're no longer inferring the type arguments as a tuple due to the binding pattern.
rbuckton commentedon Sep 16, 2021
For VS Code:
as const
to line 85Promise.all
overload removal in Adds 'Awaited' type alias and updates to Promise.all/race/allSettled/any #45350.Promise.all
overload removal in Adds 'Awaited' type alias and updates to Promise.all/race/allSettled/any #45350.I'll look into the others shortly.
rbuckton commentedon Sep 17, 2021
@mjbvz I saw that you updated pushErrorHandler.ts for TS 4.5 using an
as any
on line 107I would recommend you add
as const
on line 85 instead to preserve type safety. We are no longer treating untyped binding patterns as type argument inference sources as of #45719.mjbvz commentedon Sep 17, 2021
@rbuckton Ah nice! Just made the change. Thanks for the help as I was super confused by the error
rbuckton commentedon Sep 17, 2021
For youzan/vant:
For lensapp/lens:
getAwaitedType
returning anAwaited<T>
instantiation when checking return statements.rbuckton commentedon Sep 17, 2021
I'm unsure as to the cause of the errors in react-redux, but they don't seem to be due to
await
->Awaited<T>
change as far as I can tell.rbuckton commentedon Sep 17, 2021
Ah, the issue with react-redux is also due to #45719:
We're no longer inferring a tuple type for the return statement because we don't infer a contextual type from the binding pattern. This seems like an unfortunate loss due to that change:
vs
andrewbranch commentedon Sep 17, 2021
Hm, there are so many cases where binding patterns as an inference source are so bad, but these tuple cases are kind of disappointing. Maybe I can bring that back for tuples. It's a lot more suspicious to say that an object binding pattern implies the presence of some properties on an otherwise
unknown
type than it is to say that an array binding pattern implies that an array literal should be interpreted as a tuple.andrewbranch commentedon Sep 23, 2021
Ron fixed the
Awaited
issues and I rolled back the binding pattern changes for now (see design notes linked above). @mjbvz, you should be able to roll back theas const
changes you had to do if you want.