forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
declarationEmitDuplicateParameterDestructuring.js
46 lines (34 loc) · 1.62 KB
/
declarationEmitDuplicateParameterDestructuring.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//// [declarationEmitDuplicateParameterDestructuring.ts]
export const fn1 = ({ prop: a, prop: b }: { prop: number }) => a + b;
export const fn2 = ({ prop: a }: { prop: number }, { prop: b }: { prop: number }) => a + b;
//// [declarationEmitDuplicateParameterDestructuring.d.ts]
export declare const fn1: ({ prop, prop }: {
prop: number;
}) => number;
export declare const fn2: ({ prop }: {
prop: number;
}, { prop }: {
prop: number;
}) => number;
//// [DtsFileErrors]
tests/cases/compiler/declarationEmitDuplicateParameterDestructuring.d.ts(1,30): error TS2300: Duplicate identifier 'prop'.
tests/cases/compiler/declarationEmitDuplicateParameterDestructuring.d.ts(1,36): error TS2300: Duplicate identifier 'prop'.
tests/cases/compiler/declarationEmitDuplicateParameterDestructuring.d.ts(4,30): error TS2300: Duplicate identifier 'prop'.
tests/cases/compiler/declarationEmitDuplicateParameterDestructuring.d.ts(6,6): error TS2300: Duplicate identifier 'prop'.
==== tests/cases/compiler/declarationEmitDuplicateParameterDestructuring.d.ts (4 errors) ====
export declare const fn1: ({ prop, prop }: {
~~~~
!!! error TS2300: Duplicate identifier 'prop'.
~~~~
!!! error TS2300: Duplicate identifier 'prop'.
prop: number;
}) => number;
export declare const fn2: ({ prop }: {
~~~~
!!! error TS2300: Duplicate identifier 'prop'.
prop: number;
}, { prop }: {
~~~~
!!! error TS2300: Duplicate identifier 'prop'.
prop: number;
}) => number;