Skip to content

Commit ec6ae1c

Browse files
authoredSep 15, 2022
Partially revert #41044, restoring parameter destructurings in d.ts files (#50779)
1 parent 28232ca commit ec6ae1c

26 files changed

+190
-129
lines changed
 

‎src/compiler/checker.ts

+9-19
Original file line numberDiff line numberDiff line change
@@ -6116,29 +6116,19 @@ namespace ts {
61166116
return parameterNode;
61176117

61186118
function cloneBindingName(node: BindingName): BindingName {
6119-
return elideInitializerAndPropertyRenamingAndSetEmitFlags(node) as BindingName;
6120-
function elideInitializerAndPropertyRenamingAndSetEmitFlags(node: Node): Node {
6119+
return elideInitializerAndSetEmitFlags(node) as BindingName;
6120+
function elideInitializerAndSetEmitFlags(node: Node): Node {
61216121
if (context.tracker.trackSymbol && isComputedPropertyName(node) && isLateBindableName(node)) {
61226122
trackComputedName(node.expression, context.enclosingDeclaration, context);
61236123
}
6124-
let visited = visitEachChild(node, elideInitializerAndPropertyRenamingAndSetEmitFlags, nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndPropertyRenamingAndSetEmitFlags)!;
6124+
let visited = visitEachChild(node, elideInitializerAndSetEmitFlags, nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags)!;
61256125
if (isBindingElement(visited)) {
6126-
if (visited.propertyName && isIdentifier(visited.propertyName) && isIdentifier(visited.name) && !isStringAKeyword(idText(visited.propertyName))) {
6127-
visited = factory.updateBindingElement(
6128-
visited,
6129-
visited.dotDotDotToken,
6130-
/* propertyName*/ undefined,
6131-
visited.propertyName,
6132-
/*initializer*/ undefined);
6133-
}
6134-
else {
6135-
visited = factory.updateBindingElement(
6136-
visited,
6137-
visited.dotDotDotToken,
6138-
visited.propertyName,
6139-
visited.name,
6140-
/*initializer*/ undefined);
6141-
}
6126+
visited = factory.updateBindingElement(
6127+
visited,
6128+
visited.dotDotDotToken,
6129+
visited.propertyName,
6130+
visited.name,
6131+
/*initializer*/ undefined);
61426132
}
61436133
if (!nodeIsSynthesized(visited)) {
61446134
visited = factory.cloneNode(visited);

‎tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interface Show {
55
>x : number
66
}
77
function f({ show: showRename = v => v }: Show) {}
8-
>f : ({ show }: Show) => void
8+
>f : ({ show: showRename }: Show) => void
99
>show : any
1010
>showRename : (x: number) => string
1111
>v => v : (v: number) => number
@@ -32,7 +32,7 @@ interface Nested {
3232
>nested : Show
3333
}
3434
function ff({ nested: nestedRename = { show: v => v } }: Nested) {}
35-
>ff : ({ nested }: Nested) => void
35+
>ff : ({ nested: nestedRename }: Nested) => void
3636
>nested : any
3737
>nestedRename : Show
3838
>{ show: v => v } : { show: (v: number) => number; }

‎tests/baselines/reference/declarationEmitBindingPatternWithReservedWord.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ export interface GetLocalesOptions<T extends LocaleData> {
4444
config?: LocaleConfig<T> | undefined;
4545
name?: string;
4646
}
47-
export declare const getLocales: <T extends LocaleData>({ app, name, default: defaultLocalesConfig, config, }: GetLocalesOptions<T>) => ConvertLocaleConfig<T>;
47+
export declare const getLocales: <T extends LocaleData>({ app, name, default: defaultLocalesConfig, config: userLocalesConfig, }: GetLocalesOptions<T>) => ConvertLocaleConfig<T>;
4848
export {};

‎tests/baselines/reference/declarationEmitBindingPatternWithReservedWord.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export interface GetLocalesOptions<T extends LocaleData> {
2626
}
2727

2828
export const getLocales = <T extends LocaleData>({
29-
>getLocales : <T extends LocaleData>({ app, name, default: defaultLocalesConfig, config, }: GetLocalesOptions<T>) => ConvertLocaleConfig<T>
30-
><T extends LocaleData>({ app, name, default: defaultLocalesConfig, config: userLocalesConfig = {},}: GetLocalesOptions<T>): ConvertLocaleConfig<T> => { return defaultLocalesConfig;} : <T extends LocaleData>({ app, name, default: defaultLocalesConfig, config, }: GetLocalesOptions<T>) => ConvertLocaleConfig<T>
29+
>getLocales : <T extends LocaleData>({ app, name, default: defaultLocalesConfig, config: userLocalesConfig, }: GetLocalesOptions<T>) => ConvertLocaleConfig<T>
30+
><T extends LocaleData>({ app, name, default: defaultLocalesConfig, config: userLocalesConfig = {},}: GetLocalesOptions<T>): ConvertLocaleConfig<T> => { return defaultLocalesConfig;} : <T extends LocaleData>({ app, name, default: defaultLocalesConfig, config: userLocalesConfig, }: GetLocalesOptions<T>) => ConvertLocaleConfig<T>
3131

3232
app,
3333
>app : unknown

‎tests/baselines/reference/declarationEmitBindingPatterns.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function f(_a, _b, _c) {
1818

1919

2020
//// [declarationEmitBindingPatterns.d.ts]
21-
declare const k: ({ x }: {
21+
declare const k: ({ x: z }: {
2222
x?: string;
2323
}) => void;
2424
declare var a: any;

‎tests/baselines/reference/declarationEmitBindingPatterns.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
=== tests/cases/compiler/declarationEmitBindingPatterns.ts ===
22
const k = ({x: z = 'y'}) => { }
3-
>k : ({ x }: { x?: string; }) => void
4-
>({x: z = 'y'}) => { } : ({ x }: { x?: string; }) => void
3+
>k : ({ x: z }: { x?: string; }) => void
4+
>({x: z = 'y'}) => { } : ({ x: z }: { x?: string; }) => void
55
>x : any
66
>z : string
77
>'y' : "y"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//// [declarationEmitDuplicateParameterDestructuring.ts]
2+
export const fn1 = ({ prop: a, prop: b }: { prop: number }) => a + b;
3+
4+
export const fn2 = ({ prop: a }: { prop: number }, { prop: b }: { prop: number }) => a + b;
5+
6+
7+
8+
9+
//// [declarationEmitDuplicateParameterDestructuring.d.ts]
10+
export declare const fn1: ({ prop: a, prop: b }: {
11+
prop: number;
12+
}) => number;
13+
export declare const fn2: ({ prop: a }: {
14+
prop: number;
15+
}, { prop: b }: {
16+
prop: number;
17+
}) => number;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
=== tests/cases/compiler/declarationEmitDuplicateParameterDestructuring.ts ===
2+
export const fn1 = ({ prop: a, prop: b }: { prop: number }) => a + b;
3+
>fn1 : Symbol(fn1, Decl(declarationEmitDuplicateParameterDestructuring.ts, 0, 12))
4+
>prop : Symbol(prop, Decl(declarationEmitDuplicateParameterDestructuring.ts, 0, 43))
5+
>a : Symbol(a, Decl(declarationEmitDuplicateParameterDestructuring.ts, 0, 21))
6+
>prop : Symbol(prop, Decl(declarationEmitDuplicateParameterDestructuring.ts, 0, 43))
7+
>b : Symbol(b, Decl(declarationEmitDuplicateParameterDestructuring.ts, 0, 30))
8+
>prop : Symbol(prop, Decl(declarationEmitDuplicateParameterDestructuring.ts, 0, 43))
9+
>a : Symbol(a, Decl(declarationEmitDuplicateParameterDestructuring.ts, 0, 21))
10+
>b : Symbol(b, Decl(declarationEmitDuplicateParameterDestructuring.ts, 0, 30))
11+
12+
export const fn2 = ({ prop: a }: { prop: number }, { prop: b }: { prop: number }) => a + b;
13+
>fn2 : Symbol(fn2, Decl(declarationEmitDuplicateParameterDestructuring.ts, 2, 12))
14+
>prop : Symbol(prop, Decl(declarationEmitDuplicateParameterDestructuring.ts, 2, 34))
15+
>a : Symbol(a, Decl(declarationEmitDuplicateParameterDestructuring.ts, 2, 21))
16+
>prop : Symbol(prop, Decl(declarationEmitDuplicateParameterDestructuring.ts, 2, 34))
17+
>prop : Symbol(prop, Decl(declarationEmitDuplicateParameterDestructuring.ts, 2, 65))
18+
>b : Symbol(b, Decl(declarationEmitDuplicateParameterDestructuring.ts, 2, 52))
19+
>prop : Symbol(prop, Decl(declarationEmitDuplicateParameterDestructuring.ts, 2, 65))
20+
>a : Symbol(a, Decl(declarationEmitDuplicateParameterDestructuring.ts, 2, 21))
21+
>b : Symbol(b, Decl(declarationEmitDuplicateParameterDestructuring.ts, 2, 52))
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
=== tests/cases/compiler/declarationEmitDuplicateParameterDestructuring.ts ===
2+
export const fn1 = ({ prop: a, prop: b }: { prop: number }) => a + b;
3+
>fn1 : ({ prop: a, prop: b }: { prop: number;}) => number
4+
>({ prop: a, prop: b }: { prop: number }) => a + b : ({ prop: a, prop: b }: { prop: number;}) => number
5+
>prop : any
6+
>a : number
7+
>prop : any
8+
>b : number
9+
>prop : number
10+
>a + b : number
11+
>a : number
12+
>b : number
13+
14+
export const fn2 = ({ prop: a }: { prop: number }, { prop: b }: { prop: number }) => a + b;
15+
>fn2 : ({ prop: a }: { prop: number;}, { prop: b }: { prop: number;}) => number
16+
>({ prop: a }: { prop: number }, { prop: b }: { prop: number }) => a + b : ({ prop: a }: { prop: number;}, { prop: b }: { prop: number;}) => number
17+
>prop : any
18+
>a : number
19+
>prop : number
20+
>prop : any
21+
>b : number
22+
>prop : number
23+
>a + b : number
24+
>a : number
25+
>b : number
26+

‎tests/baselines/reference/declarationsAndAssignments.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ function f13() {
417417
}
418418

419419
function f14([a = 1, [b = "hello", { x, y: c = false }]]) {
420-
>f14 : ([a, [b, { x, y }]]: [number, [string, { x: any; y?: boolean; }]]) => void
420+
>f14 : ([a, [b, { x, y: c }]]: [number, [string, { x: any; y?: boolean; }]]) => void
421421
>a : number
422422
>1 : 1
423423
>b : string
@@ -438,7 +438,7 @@ function f14([a = 1, [b = "hello", { x, y: c = false }]]) {
438438
}
439439
f14([2, ["abc", { x: 0, y: true }]]);
440440
>f14([2, ["abc", { x: 0, y: true }]]) : void
441-
>f14 : ([a, [b, { x, y }]]: [number, [string, { x: any; y?: boolean; }]]) => void
441+
>f14 : ([a, [b, { x, y: c }]]: [number, [string, { x: any; y?: boolean; }]]) => void
442442
>[2, ["abc", { x: 0, y: true }]] : [number, [string, { x: number; y: true; }]]
443443
>2 : 2
444444
>["abc", { x: 0, y: true }] : [string, { x: number; y: true; }]
@@ -451,7 +451,7 @@ f14([2, ["abc", { x: 0, y: true }]]);
451451

452452
f14([2, ["abc", { x: 0 }]]);
453453
>f14([2, ["abc", { x: 0 }]]) : void
454-
>f14 : ([a, [b, { x, y }]]: [number, [string, { x: any; y?: boolean; }]]) => void
454+
>f14 : ([a, [b, { x, y: c }]]: [number, [string, { x: any; y?: boolean; }]]) => void
455455
>[2, ["abc", { x: 0 }]] : [number, [string, { x: number; }]]
456456
>2 : 2
457457
>["abc", { x: 0 }] : [string, { x: number; }]
@@ -462,7 +462,7 @@ f14([2, ["abc", { x: 0 }]]);
462462

463463
f14([2, ["abc", { y: false }]]); // Error, no x
464464
>f14([2, ["abc", { y: false }]]) : void
465-
>f14 : ([a, [b, { x, y }]]: [number, [string, { x: any; y?: boolean; }]]) => void
465+
>f14 : ([a, [b, { x, y: c }]]: [number, [string, { x: any; y?: boolean; }]]) => void
466466
>[2, ["abc", { y: false }]] : [number, [string, { y: false; }]]
467467
>2 : 2
468468
>["abc", { y: false }] : [string, { y: false; }]

‎tests/baselines/reference/destructuringInFunctionType.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type T3 = ([{ a: b }, { b: a }]);
3131
>b : a
3232

3333
type F3 = ([{ a: b }, { b: a }]) => void;
34-
>F3 : ([{ a }, { b }]: [{ a: any; }, { b: any; }]) => void
34+
>F3 : ([{ a: b }, { b: a }]: [{ a: any; }, { b: any; }]) => void
3535
>a : any
3636
>b : any
3737
>b : any

‎tests/baselines/reference/destructuringParameterDeclaration1ES5.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ d5(); // Parameter is optional as its declaration included an initializer
402402
// Type annotations must instead be written on the top- level parameter declaration
403403

404404
function e1({x: number}) { } // x has type any NOT number
405-
>e1 : ({ x }: { x: any; }) => void
405+
>e1 : ({ x: number }: { x: any; }) => void
406406
>x : any
407407
>number : any
408408

‎tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ d5(); // Parameter is optional as its declaration included an initializer
402402
// Type annotations must instead be written on the top- level parameter declaration
403403

404404
function e1({x: number}) { } // x has type any NOT number
405-
>e1 : ({ x }: { x: any; }) => void
405+
>e1 : ({ x: number }: { x: any; }) => void
406406
>x : any
407407
>number : any
408408

‎tests/baselines/reference/destructuringParameterDeclaration1ES6.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ d5(); // Parameter is optional as its declaration included an initializer
376376
// Type annotations must instead be written on the top- level parameter declaration
377377

378378
function e1({x: number}) { } // x has type any NOT number
379-
>e1 : ({ x }: { x: any; }) => void
379+
>e1 : ({ x: number }: { x: any; }) => void
380380
>x : any
381381
>number : any
382382

‎tests/baselines/reference/excessPropertyCheckWithSpread.types

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
=== tests/cases/compiler/excessPropertyCheckWithSpread.ts ===
22
declare function f({ a: number }): void
3-
>f : ({ a }: { a: any; }) => void
3+
>f : ({ a: number }: { a: any; }) => void
44
>a : any
55
>number : any
66

@@ -13,7 +13,7 @@ declare let i: I;
1313

1414
f({ a: 1, ...i });
1515
>f({ a: 1, ...i }) : void
16-
>f : ({ a }: { a: any; }) => void
16+
>f : ({ a: number }: { a: any; }) => void
1717
>{ a: 1, ...i } : { n: number; a: number; }
1818
>a : number
1919
>1 : 1
@@ -35,7 +35,7 @@ declare let r: R;
3535

3636
f({ a: 1, ...l, ...r });
3737
>f({ a: 1, ...l, ...r }) : void
38-
>f : ({ a }: { a: any; }) => void
38+
>f : ({ a: number }: { a: any; }) => void
3939
>{ a: 1, ...l, ...r } : { opt: string | number; a: number; }
4040
>a : number
4141
>1 : 1

‎tests/baselines/reference/objectRestParameter.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ declare function suddenly(f: (a: { x: { z, ka }, y: string }) => void);
1919
suddenly(({ x: a, ...rest }) => rest.y);
2020
>suddenly(({ x: a, ...rest }) => rest.y) : any
2121
>suddenly : (f: (a: { x: { z: any; ka: any; }; y: string; }) => void) => any
22-
>({ x: a, ...rest }) => rest.y : ({ x, ...rest }: { x: { z: any; ka: any; }; y: string; }) => string
22+
>({ x: a, ...rest }) => rest.y : ({ x: a, ...rest }: { x: { z: any; ka: any; }; y: string; }) => string
2323
>x : any
2424
>a : { z: any; ka: any; }
2525
>rest : { y: string; }

‎tests/baselines/reference/objectRestParameterES5.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ declare function suddenly(f: (a: { x: { z, ka }, y: string }) => void);
1919
suddenly(({ x: a, ...rest }) => rest.y);
2020
>suddenly(({ x: a, ...rest }) => rest.y) : any
2121
>suddenly : (f: (a: { x: { z: any; ka: any; }; y: string; }) => void) => any
22-
>({ x: a, ...rest }) => rest.y : ({ x, ...rest }: { x: { z: any; ka: any; }; y: string; }) => string
22+
>({ x: a, ...rest }) => rest.y : ({ x: a, ...rest }: { x: { z: any; ka: any; }; y: string; }) => string
2323
>x : any
2424
>a : { z: any; ka: any; }
2525
>rest : { y: string; }

‎tests/baselines/reference/renamingDestructuredPropertyInFunctionType.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,18 @@ interface I {
167167
}): any;
168168
}
169169
declare function f1({ a }: O): void;
170-
declare const f2: ({ a }: O) => void;
171-
declare const f3: ({ a, b, c }: O) => void;
172-
declare const f4: ({ a }: O) => string;
173-
declare const f5: ({ a, b, c }: O) => string;
170+
declare const f2: ({ a: string }: O) => void;
171+
declare const f3: ({ a: string, b, c }: O) => void;
172+
declare const f4: ({ a: string }: O) => string;
173+
declare const f5: ({ a: string, b, c }: O) => string;
174174
declare const obj1: {
175-
method({ a }: O): void;
175+
method({ a: string }: O): void;
176176
};
177177
declare const obj2: {
178-
method({ a }: O): string;
178+
method({ a: string }: O): string;
179179
};
180180
declare function f6({ a }: O): void;
181-
declare const f7: ({ a, b, c }: O) => void;
181+
declare const f7: ({ a: string, b, c }: O) => void;
182182
declare const f8: ({ "a": string }: O) => void;
183183
declare function f9({ 2: string }: {
184184
2: any;

‎tests/baselines/reference/renamingDestructuredPropertyInFunctionType.types

+34-34
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,45 @@ type F1 = (arg: number) => any; // OK
1212
>arg : number
1313

1414
type F2 = ({ a: string }: O) => any; // Error
15-
>F2 : ({ a }: O) => any
15+
>F2 : ({ a: string }: O) => any
1616
>a : any
1717
>string : string
1818

1919
type F3 = ({ a: string, b, c }: O) => any; // Error
20-
>F3 : ({ a, b, c }: O) => any
20+
>F3 : ({ a: string, b, c }: O) => any
2121
>a : any
2222
>string : string
2323
>b : number
2424
>c : number
2525

2626
type F4 = ({ a: string }: O) => any; // Error
27-
>F4 : ({ a }: O) => any
27+
>F4 : ({ a: string }: O) => any
2828
>a : any
2929
>string : string
3030

3131
type F5 = ({ a: string, b, c }: O) => any; // Error
32-
>F5 : ({ a, b, c }: O) => any
32+
>F5 : ({ a: string, b, c }: O) => any
3333
>a : any
3434
>string : string
3535
>b : number
3636
>c : number
3737

3838
type F6 = ({ a: string }) => typeof string; // OK
39-
>F6 : ({ a }: { a: any; }) => any
39+
>F6 : ({ a: string }: { a: any; }) => any
4040
>a : any
4141
>string : any
4242
>string : any
4343

4444
type F7 = ({ a: string, b: number }) => typeof number; // Error
45-
>F7 : ({ a, b }: { a: any; b: any; }) => any
45+
>F7 : ({ a: string, b: number }: { a: any; b: any; }) => any
4646
>a : any
4747
>string : any
4848
>b : any
4949
>number : any
5050
>number : any
5151

5252
type F8 = ({ a, b: number }) => typeof number; // OK
53-
>F8 : ({ a, b }: { a: any; b: any; }) => any
53+
>F8 : ({ a, b: number }: { a: any; b: any; }) => any
5454
>a : any
5555
>b : any
5656
>number : any
@@ -67,45 +67,45 @@ type G1 = new (arg: number) => any; // OK
6767
>arg : number
6868

6969
type G2 = new ({ a: string }: O) => any; // Error
70-
>G2 : new ({ a }: O) => any
70+
>G2 : new ({ a: string }: O) => any
7171
>a : any
7272
>string : string
7373

7474
type G3 = new ({ a: string, b, c }: O) => any; // Error
75-
>G3 : new ({ a, b, c }: O) => any
75+
>G3 : new ({ a: string, b, c }: O) => any
7676
>a : any
7777
>string : string
7878
>b : number
7979
>c : number
8080

8181
type G4 = new ({ a: string }: O) => any; // Error
82-
>G4 : new ({ a }: O) => any
82+
>G4 : new ({ a: string }: O) => any
8383
>a : any
8484
>string : string
8585

8686
type G5 = new ({ a: string, b, c }: O) => any; // Error
87-
>G5 : new ({ a, b, c }: O) => any
87+
>G5 : new ({ a: string, b, c }: O) => any
8888
>a : any
8989
>string : string
9090
>b : number
9191
>c : number
9292

9393
type G6 = new ({ a: string }) => typeof string; // OK
94-
>G6 : new ({ a }: { a: any; }) => any
94+
>G6 : new ({ a: string }: { a: any; }) => any
9595
>a : any
9696
>string : any
9797
>string : any
9898

9999
type G7 = new ({ a: string, b: number }) => typeof number; // Error
100-
>G7 : new ({ a, b }: { a: any; b: any; }) => any
100+
>G7 : new ({ a: string, b: number }: { a: any; b: any; }) => any
101101
>a : any
102102
>string : any
103103
>b : any
104104
>number : any
105105
>number : any
106106

107107
type G8 = new ({ a, b: number }) => typeof number; // OK
108-
>G8 : new ({ a, b }: { a: any; b: any; }) => any
108+
>G8 : new ({ a, b: number }: { a: any; b: any; }) => any
109109
>a : any
110110
>b : any
111111
>number : any
@@ -161,7 +161,7 @@ interface I {
161161
>arg : number
162162

163163
method2({ a: string }): any; // Error
164-
>method2 : ({ a }: { a: any; }) => any
164+
>method2 : ({ a: string }: { a: any; }) => any
165165
>a : any
166166
>string : any
167167

@@ -182,35 +182,35 @@ interface I {
182182

183183
// Below are OK but renaming should be removed from declaration emit
184184
function f1({ a: string }: O) { }
185-
>f1 : ({ a }: O) => void
185+
>f1 : ({ a: string }: O) => void
186186
>a : any
187187
>string : string
188188

189189
const f2 = function({ a: string }: O) { };
190-
>f2 : ({ a }: O) => void
191-
>function({ a: string }: O) { } : ({ a }: O) => void
190+
>f2 : ({ a: string }: O) => void
191+
>function({ a: string }: O) { } : ({ a: string }: O) => void
192192
>a : any
193193
>string : string
194194

195195
const f3 = ({ a: string, b, c }: O) => { };
196-
>f3 : ({ a, b, c }: O) => void
197-
>({ a: string, b, c }: O) => { } : ({ a, b, c }: O) => void
196+
>f3 : ({ a: string, b, c }: O) => void
197+
>({ a: string, b, c }: O) => { } : ({ a: string, b, c }: O) => void
198198
>a : any
199199
>string : string
200200
>b : number
201201
>c : number
202202

203203
const f4 = function({ a: string }: O): typeof string { return string; };
204-
>f4 : ({ a }: O) => string
205-
>function({ a: string }: O): typeof string { return string; } : ({ a }: O) => string
204+
>f4 : ({ a: string }: O) => string
205+
>function({ a: string }: O): typeof string { return string; } : ({ a: string }: O) => string
206206
>a : any
207207
>string : string
208208
>string : string
209209
>string : string
210210

211211
const f5 = ({ a: string, b, c }: O): typeof string => '';
212-
>f5 : ({ a, b, c }: O) => string
213-
>({ a: string, b, c }: O): typeof string => '' : ({ a, b, c }: O) => string
212+
>f5 : ({ a: string, b, c }: O) => string
213+
>({ a: string, b, c }: O): typeof string => '' : ({ a: string, b, c }: O) => string
214214
>a : any
215215
>string : string
216216
>b : number
@@ -219,36 +219,36 @@ const f5 = ({ a: string, b, c }: O): typeof string => '';
219219
>'' : ""
220220

221221
const obj1 = {
222-
>obj1 : { method({ a }: O): void; }
223-
>{ method({ a: string }: O) { }} : { method({ a }: O): void; }
222+
>obj1 : { method({ a: string }: O): void; }
223+
>{ method({ a: string }: O) { }} : { method({ a: string }: O): void; }
224224

225225
method({ a: string }: O) { }
226-
>method : ({ a }: O) => void
226+
>method : ({ a: string }: O) => void
227227
>a : any
228228
>string : string
229229

230230
};
231231
const obj2 = {
232-
>obj2 : { method({ a }: O): string; }
233-
>{ method({ a: string }: O): typeof string { return string; }} : { method({ a }: O): string; }
232+
>obj2 : { method({ a: string }: O): string; }
233+
>{ method({ a: string }: O): typeof string { return string; }} : { method({ a: string }: O): string; }
234234

235235
method({ a: string }: O): typeof string { return string; }
236-
>method : ({ a }: O) => string
236+
>method : ({ a: string }: O) => string
237237
>a : any
238238
>string : string
239239
>string : string
240240
>string : string
241241

242242
};
243243
function f6({ a: string = "" }: O) { }
244-
>f6 : ({ a }: O) => void
244+
>f6 : ({ a: string }: O) => void
245245
>a : any
246246
>string : string
247247
>"" : ""
248248

249249
const f7 = ({ a: string = "", b, c }: O) => { };
250-
>f7 : ({ a, b, c }: O) => void
251-
>({ a: string = "", b, c }: O) => { } : ({ a, b, c }: O) => void
250+
>f7 : ({ a: string, b, c }: O) => void
251+
>({ a: string = "", b, c }: O) => { } : ({ a: string, b, c }: O) => void
252252
>a : any
253253
>string : string
254254
>"" : ""
@@ -277,7 +277,7 @@ const f11 = ({ [2]: string }) => { };
277277

278278
// In below case `string` should be kept because it is used
279279
function f12({ a: string = "" }: O): typeof string { return "a"; }
280-
>f12 : ({ a }: O) => typeof string
280+
>f12 : ({ a: string }: O) => typeof string
281281
>a : any
282282
>string : string
283283
>"" : ""

‎tests/baselines/reference/renamingDestructuredPropertyInFunctionType2.types

+15-15
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,45 @@ type F1 = (arg: number) => any;
1010
>arg : number
1111

1212
type F2 = ({ a: string }: O) => any;
13-
>F2 : ({ a }: O) => any
13+
>F2 : ({ a: string }: O) => any
1414
>a : any
1515
>string : string
1616

1717
type F3 = ({ a: string, b, c }: O) => any;
18-
>F3 : ({ a, b, c }: O) => any
18+
>F3 : ({ a: string, b, c }: O) => any
1919
>a : any
2020
>string : string
2121
>b : number
2222
>c : number
2323

2424
type F4 = ({ a: string }: O) => any;
25-
>F4 : ({ a }: O) => any
25+
>F4 : ({ a: string }: O) => any
2626
>a : any
2727
>string : string
2828

2929
type F5 = ({ a: string, b, c }: O) => any;
30-
>F5 : ({ a, b, c }: O) => any
30+
>F5 : ({ a: string, b, c }: O) => any
3131
>a : any
3232
>string : string
3333
>b : number
3434
>c : number
3535

3636
type F6 = ({ a: string }) => typeof string;
37-
>F6 : ({ a }: { a: any; }) => any
37+
>F6 : ({ a: string }: { a: any; }) => any
3838
>a : any
3939
>string : any
4040
>string : any
4141

4242
type F7 = ({ a: string, b: number }) => typeof number;
43-
>F7 : ({ a, b }: { a: any; b: any; }) => any
43+
>F7 : ({ a: string, b: number }: { a: any; b: any; }) => any
4444
>a : any
4545
>string : any
4646
>b : any
4747
>number : any
4848
>number : any
4949

5050
type F8 = ({ a, b: number }) => typeof number;
51-
>F8 : ({ a, b }: { a: any; b: any; }) => any
51+
>F8 : ({ a, b: number }: { a: any; b: any; }) => any
5252
>a : any
5353
>b : any
5454
>number : any
@@ -65,45 +65,45 @@ type G1 = (arg: number) => any;
6565
>arg : number
6666

6767
type G2 = ({ a: string }: O) => any;
68-
>G2 : ({ a }: O) => any
68+
>G2 : ({ a: string }: O) => any
6969
>a : any
7070
>string : string
7171

7272
type G3 = ({ a: string, b, c }: O) => any;
73-
>G3 : ({ a, b, c }: O) => any
73+
>G3 : ({ a: string, b, c }: O) => any
7474
>a : any
7575
>string : string
7676
>b : number
7777
>c : number
7878

7979
type G4 = ({ a: string }: O) => any;
80-
>G4 : ({ a }: O) => any
80+
>G4 : ({ a: string }: O) => any
8181
>a : any
8282
>string : string
8383

8484
type G5 = ({ a: string, b, c }: O) => any;
85-
>G5 : ({ a, b, c }: O) => any
85+
>G5 : ({ a: string, b, c }: O) => any
8686
>a : any
8787
>string : string
8888
>b : number
8989
>c : number
9090

9191
type G6 = ({ a: string }) => typeof string;
92-
>G6 : ({ a }: { a: any; }) => any
92+
>G6 : ({ a: string }: { a: any; }) => any
9393
>a : any
9494
>string : any
9595
>string : any
9696

9797
type G7 = ({ a: string, b: number }) => typeof number;
98-
>G7 : ({ a, b }: { a: any; b: any; }) => any
98+
>G7 : ({ a: string, b: number }: { a: any; b: any; }) => any
9999
>a : any
100100
>string : any
101101
>b : any
102102
>number : any
103103
>number : any
104104

105105
type G8 = ({ a, b: number }) => typeof number;
106-
>G8 : ({ a, b }: { a: any; b: any; }) => any
106+
>G8 : ({ a, b: number }: { a: any; b: any; }) => any
107107
>a : any
108108
>b : any
109109
>number : any
@@ -121,7 +121,7 @@ interface I {
121121
>arg : number
122122

123123
method2({ a: string }): any;
124-
>method2 : ({ a }: { a: any; }) => any
124+
>method2 : ({ a: string }: { a: any; }) => any
125125
>a : any
126126
>string : any
127127

‎tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no
3434
>"none" : "none"
3535

3636
function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) {
37-
>foo1 : ({ skills: { primary, secondary } }: Robot) => void
37+
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void
3838
>skills : any
3939
>primary : any
4040
>primaryA : string
@@ -49,7 +49,7 @@ function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) {
4949
>primaryA : string
5050
}
5151
function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) {
52-
>foo2 : ({ name, skills: { primary, secondary } }: Robot) => void
52+
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void
5353
>name : any
5454
>nameC : string
5555
>skills : any
@@ -81,12 +81,12 @@ function foo3({ skills }: Robot) {
8181

8282
foo1(robotA);
8383
>foo1(robotA) : void
84-
>foo1 : ({ skills: { primary, secondary } }: Robot) => void
84+
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void
8585
>robotA : Robot
8686

8787
foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
8888
>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
89-
>foo1 : ({ skills: { primary, secondary } }: Robot) => void
89+
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void
9090
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
9191
>name : string
9292
>"Edger" : "Edger"
@@ -99,12 +99,12 @@ foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming"
9999

100100
foo2(robotA);
101101
>foo2(robotA) : void
102-
>foo2 : ({ name, skills: { primary, secondary } }: Robot) => void
102+
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void
103103
>robotA : Robot
104104

105105
foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
106106
>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
107-
>foo2 : ({ name, skills: { primary, secondary } }: Robot) => void
107+
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void
108108
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
109109
>name : string
110110
>"Edger" : "Edger"

‎tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no
3434
>"none" : "none"
3535

3636
function foo1(
37-
>foo1 : ({ skills: { primary, secondary } }?: Robot) => void
37+
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }?: Robot) => void
3838
{
3939
skills: {
4040
>skills : any
@@ -67,7 +67,7 @@ function foo1(
6767
>primaryA : string
6868
}
6969
function foo2(
70-
>foo2 : ({ name, skills: { primary, secondary } }?: Robot) => void
70+
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }?: Robot) => void
7171
{
7272
name: nameC = "name",
7373
>name : any
@@ -126,12 +126,12 @@ function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Ro
126126

127127
foo1(robotA);
128128
>foo1(robotA) : void
129-
>foo1 : ({ skills: { primary, secondary } }?: Robot) => void
129+
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }?: Robot) => void
130130
>robotA : Robot
131131

132132
foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
133133
>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
134-
>foo1 : ({ skills: { primary, secondary } }?: Robot) => void
134+
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }?: Robot) => void
135135
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
136136
>name : string
137137
>"Edger" : "Edger"
@@ -144,12 +144,12 @@ foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming"
144144

145145
foo2(robotA);
146146
>foo2(robotA) : void
147-
>foo2 : ({ name, skills: { primary, secondary } }?: Robot) => void
147+
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }?: Robot) => void
148148
>robotA : Robot
149149

150150
foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
151151
>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
152-
>foo2 : ({ name, skills: { primary, secondary } }?: Robot) => void
152+
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }?: Robot) => void
153153
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
154154
>name : string
155155
>"Edger" : "Edger"

‎tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" };
2626
>"mowing" : "mowing"
2727

2828
function foo1({ name: nameA }: Robot) {
29-
>foo1 : ({ name }: Robot) => void
29+
>foo1 : ({ name: nameA }: Robot) => void
3030
>name : any
3131
>nameA : string
3232

@@ -38,7 +38,7 @@ function foo1({ name: nameA }: Robot) {
3838
>nameA : string
3939
}
4040
function foo2({ name: nameB, skill: skillB }: Robot) {
41-
>foo2 : ({ name, skill }: Robot) => void
41+
>foo2 : ({ name: nameB, skill: skillB }: Robot) => void
4242
>name : any
4343
>nameB : string
4444
>skill : any
@@ -65,12 +65,12 @@ function foo3({ name }: Robot) {
6565

6666
foo1(robotA);
6767
>foo1(robotA) : void
68-
>foo1 : ({ name }: Robot) => void
68+
>foo1 : ({ name: nameA }: Robot) => void
6969
>robotA : Robot
7070

7171
foo1({ name: "Edger", skill: "cutting edges" });
7272
>foo1({ name: "Edger", skill: "cutting edges" }) : void
73-
>foo1 : ({ name }: Robot) => void
73+
>foo1 : ({ name: nameA }: Robot) => void
7474
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
7575
>name : string
7676
>"Edger" : "Edger"
@@ -79,12 +79,12 @@ foo1({ name: "Edger", skill: "cutting edges" });
7979

8080
foo2(robotA);
8181
>foo2(robotA) : void
82-
>foo2 : ({ name, skill }: Robot) => void
82+
>foo2 : ({ name: nameB, skill: skillB }: Robot) => void
8383
>robotA : Robot
8484

8585
foo2({ name: "Edger", skill: "cutting edges" });
8686
>foo2({ name: "Edger", skill: "cutting edges" }) : void
87-
>foo2 : ({ name, skill }: Robot) => void
87+
>foo2 : ({ name: nameB, skill: skillB }: Robot) => void
8888
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
8989
>name : string
9090
>"Edger" : "Edger"

‎tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" };
2626
>"mowing" : "mowing"
2727

2828
function foo1({ name: nameA = "<NoName>" }: Robot = { }) {
29-
>foo1 : ({ name }?: Robot) => void
29+
>foo1 : ({ name: nameA }?: Robot) => void
3030
>name : any
3131
>nameA : string
3232
>"<NoName>" : "<NoName>"
@@ -40,7 +40,7 @@ function foo1({ name: nameA = "<NoName>" }: Robot = { }) {
4040
>nameA : string
4141
}
4242
function foo2({ name: nameB = "<NoName>", skill: skillB = "noSkill" }: Robot = {}) {
43-
>foo2 : ({ name, skill }?: Robot) => void
43+
>foo2 : ({ name: nameB, skill: skillB }?: Robot) => void
4444
>name : any
4545
>nameB : string
4646
>"<NoName>" : "<NoName>"
@@ -72,12 +72,12 @@ function foo3({ name = "<NoName>" }: Robot = {}) {
7272

7373
foo1(robotA);
7474
>foo1(robotA) : void
75-
>foo1 : ({ name }?: Robot) => void
75+
>foo1 : ({ name: nameA }?: Robot) => void
7676
>robotA : Robot
7777

7878
foo1({ name: "Edger", skill: "cutting edges" });
7979
>foo1({ name: "Edger", skill: "cutting edges" }) : void
80-
>foo1 : ({ name }?: Robot) => void
80+
>foo1 : ({ name: nameA }?: Robot) => void
8181
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
8282
>name : string
8383
>"Edger" : "Edger"
@@ -86,12 +86,12 @@ foo1({ name: "Edger", skill: "cutting edges" });
8686

8787
foo2(robotA);
8888
>foo2(robotA) : void
89-
>foo2 : ({ name, skill }?: Robot) => void
89+
>foo2 : ({ name: nameB, skill: skillB }?: Robot) => void
9090
>robotA : Robot
9191

9292
foo2({ name: "Edger", skill: "cutting edges" });
9393
>foo2({ name: "Edger", skill: "cutting edges" }) : void
94-
>foo2 : ({ name, skill }?: Robot) => void
94+
>foo2 : ({ name: nameB, skill: skillB }?: Robot) => void
9595
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
9696
>name : string
9797
>"Edger" : "Edger"

‎tests/baselines/reference/tsxStatelessFunctionComponentOverload1.types

+9-9
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,27 @@ const c5 = <OneThing yxx1='ok'>Hello</OneThing>
7575

7676

7777
declare function TestingOneThing({y1: string}): JSX.Element;
78-
>TestingOneThing : { ({ y1 }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
78+
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
7979
>y1 : any
8080
>string : any
8181
>JSX : any
8282

8383
declare function TestingOneThing(j: {"extra-data": string, yy?: string}): JSX.Element;
84-
>TestingOneThing : { ({ y1 }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string;}): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
84+
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string;}): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
8585
>j : { "extra-data": string; yy?: string; }
8686
>"extra-data" : string
8787
>yy : string
8888
>JSX : any
8989

9090
declare function TestingOneThing(n: {yy: number, direction?: number}): JSX.Element;
91-
>TestingOneThing : { ({ y1 }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number;}): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
91+
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number;}): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
9292
>n : { yy: number; direction?: number; }
9393
>yy : number
9494
>direction : number
9595
>JSX : any
9696

9797
declare function TestingOneThing(n: {yy: string, name: string}): JSX.Element;
98-
>TestingOneThing : { ({ y1 }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string;}): JSX.Element; }
98+
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string;}): JSX.Element; }
9999
>n : { yy: string; name: string; }
100100
>yy : string
101101
>name : string
@@ -105,27 +105,27 @@ declare function TestingOneThing(n: {yy: string, name: string}): JSX.Element;
105105
const d1 = <TestingOneThing y1 extra-data />;
106106
>d1 : JSX.Element
107107
><TestingOneThing y1 extra-data /> : JSX.Element
108-
>TestingOneThing : { ({ y1 }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
108+
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
109109
>y1 : true
110110
>extra-data : true
111111

112112
const d2 = <TestingOneThing extra-data="hello" />;
113113
>d2 : JSX.Element
114114
><TestingOneThing extra-data="hello" /> : JSX.Element
115-
>TestingOneThing : { ({ y1 }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
115+
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
116116
>extra-data : string
117117

118118
const d3 = <TestingOneThing extra-data="hello" yy="hihi" />;
119119
>d3 : JSX.Element
120120
><TestingOneThing extra-data="hello" yy="hihi" /> : JSX.Element
121-
>TestingOneThing : { ({ y1 }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
121+
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
122122
>extra-data : string
123123
>yy : string
124124

125125
const d4 = <TestingOneThing extra-data="hello" yy={9} direction={10} />;
126126
>d4 : JSX.Element
127127
><TestingOneThing extra-data="hello" yy={9} direction={10} /> : JSX.Element
128-
>TestingOneThing : { ({ y1 }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
128+
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
129129
>extra-data : string
130130
>yy : number
131131
>9 : 9
@@ -135,7 +135,7 @@ const d4 = <TestingOneThing extra-data="hello" yy={9} direction={10} />;
135135
const d5 = <TestingOneThing extra-data="hello" yy="hello" name="Bob" />;
136136
>d5 : JSX.Element
137137
><TestingOneThing extra-data="hello" yy="hello" name="Bob" /> : JSX.Element
138-
>TestingOneThing : { ({ y1 }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
138+
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
139139
>extra-data : string
140140
>yy : string
141141
>name : string
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @declaration: true
2+
// @emitDeclarationOnly: true
3+
4+
export const fn1 = ({ prop: a, prop: b }: { prop: number }) => a + b;
5+
6+
export const fn2 = ({ prop: a }: { prop: number }, { prop: b }: { prop: number }) => a + b;

0 commit comments

Comments
 (0)
Please sign in to comment.