File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -397,7 +397,7 @@ export function createSignatureDeclarationFromSignature(
397397
398398 let typeParameters = isJs ? undefined : signatureDeclaration . typeParameters ;
399399 let parameters = signatureDeclaration . parameters ;
400- let type = isJs ? undefined : signatureDeclaration . type ;
400+ let type = isJs ? undefined : getSynthesizedDeepClone ( signatureDeclaration . type ) ;
401401 if ( importAdder ) {
402402 if ( typeParameters ) {
403403 const newTypeParameters = sameMap ( typeParameters , typeParameterDecl => {
Original file line number Diff line number Diff line change 1+ /// <reference path='fourslash.ts' />
2+
3+ ////type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
4+ ////
5+ ////export type DeepPartial<T> = T extends Builtin ? T :
6+ //// T extends Array<infer U> ? Array<DeepPartial<U>> :
7+ //// T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> :
8+ //// T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> } : Partial<T>;
9+ ////
10+ ////export interface Nested {
11+ //// field: string;
12+ //// }
13+ ////
14+ ////interface Foo {
15+ //// request(): DeepPartial<{ nested1: Nested; test2: Nested }>;
16+ //// }
17+ ////[|export class C implements Foo {}|]
18+
19+ verify . codeFix ( {
20+ description : "Implement interface 'Foo'" ,
21+ newRangeContent :
22+ `export class C implements Foo {
23+ request(): { nested1?: { field?: string; }; test2?: { field?: string; }; } {
24+ throw new Error("Method not implemented.");
25+ }
26+ }` ,
27+ } ) ;
You can’t perform that action at this time.
0 commit comments