-
Notifications
You must be signed in to change notification settings - Fork 12.8k
[NewErrors] 5.3.0-dev.20230917 vs 5.2.2 #55768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
@andrewbranch can you see what's going on here? |
I think both of these are correct errors caused by #55638. In each case, there’s a type produced by this conditional type: /**
* Mapped-type that replaces all JSONable-types with their toJSON-result type
*/
export type Dto<T> = T extends { toJSON(): infer U }
? U
: T extends VSBuffer // VSBuffer is understood by rpc-logic
? T
: T extends CancellationToken // CancellationToken is understood by rpc-logic
? T
: T extends Function // functions are dropped during JSON-stringify
? never
: T extends object // recurse
? { [k in keyof T]: Dto<T[k]>; }
: T; and a deeply nested property produced by the recursion of the mapped type branch here that legitimately doesn’t match the target. In the overload case, the issue is caused by the recursion on ![]() I tried naively unwrapping
The target type mentioned there is spelled out in export type IWorkspaceFileEditDto = Dto<
Omit<languages.IWorkspaceFileEdit, 'options'> & {
options?: Omit<languages.WorkspaceFileEditOptions, 'contents'> & { contents?: { type: 'base64'; value: string } | { type: 'dataTransferItem'; id: string } };
}>; This type seems to expect the let t1: IWorkspaceFileEditDto = undefined!;
let s1: Dto<IWorkspaceFileEdit> = undefined!;
t1 = s1; This assignment use to succeed, I think because |
@mjbvz FYI 👆 |
The following errors were reported by 5.3.0-dev.20230917, but not by 5.2.2
Pipeline that generated this bug
Logs for the pipeline run
File that generated the pipeline
This run considered 200 popular TS repos from GH (after skipping the top 0).
Successfully analyzed 111 of 200 visited repos
Investigation Status
The text was updated successfully, but these errors were encountered: