File: destructuringInFunctionType.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (32 lines) | stat: -rw-r--r-- 1,584 bytes parent folder | download | duplicates (3)
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
tests/cases/conformance/es6/destructuring/destructuringInFunctionType.ts(12,18): error TS2842: 'b' is an unused renaming of 'a'. Did you intend to use it as a type annotation?
tests/cases/conformance/es6/destructuring/destructuringInFunctionType.ts(12,28): error TS2842: 'a' is an unused renaming of 'b'. Did you intend to use it as a type annotation?


==== tests/cases/conformance/es6/destructuring/destructuringInFunctionType.ts (2 errors) ====
    interface a { a }
    interface b { b }
    interface c { c }
    
    type T1 = ([a, b, c]);
    type F1 = ([a, b, c]) => void;
    
    type T2 = ({ a });
    type F2 = ({ a }) => void;
    
    type T3 = ([{ a: b }, { b: a }]);
    type F3 = ([{ a: b }, { b: a }]) => void;
                     ~
!!! error TS2842: 'b' is an unused renaming of 'a'. Did you intend to use it as a type annotation?
!!! related TS2843 tests/cases/conformance/es6/destructuring/destructuringInFunctionType.ts:12:32: We can only write a type for 'a' by adding a type for the entire parameter here.
                               ~
!!! error TS2842: 'a' is an unused renaming of 'b'. Did you intend to use it as a type annotation?
!!! related TS2843 tests/cases/conformance/es6/destructuring/destructuringInFunctionType.ts:12:32: We can only write a type for 'b' by adding a type for the entire parameter here.
    
    type T4 = ([{ a: [b, c] }]);
    type F4 = ([{ a: [b, c] }]) => void;
    
    type C1 = new ([{ a: [b, c] }]) => void;
    
    var v1 = ([a, b, c]) => "hello";
    var v2: ([a, b, c]) => string;