File: restParameterWithBindingPattern3.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (36 lines) | stat: -rw-r--r-- 2,383 bytes parent folder | download | duplicates (4)
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
tests/cases/compiler/restParameterWithBindingPattern3.ts(1,16): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/compiler/restParameterWithBindingPattern3.ts(1,23): error TS2322: Type 'boolean' is not assignable to type 'string'.
tests/cases/compiler/restParameterWithBindingPattern3.ts(3,23): error TS1186: A rest element cannot have an initializer.
tests/cases/compiler/restParameterWithBindingPattern3.ts(5,30): error TS2493: Tuple type '[boolean, string, number]' of length '3' has no element at index '3'.
tests/cases/compiler/restParameterWithBindingPattern3.ts(7,23): error TS2493: Tuple type '[boolean, string, number]' of length '3' has no element at index '3'.
tests/cases/compiler/restParameterWithBindingPattern3.ts(9,19): error TS2322: Type 'number' is not assignable to type 'boolean'.
tests/cases/compiler/restParameterWithBindingPattern3.ts(9,29): error TS2322: Type 'boolean' is not assignable to type 'string'.
tests/cases/compiler/restParameterWithBindingPattern3.ts(9,48): error TS2566: A rest element cannot have a property name.


==== tests/cases/compiler/restParameterWithBindingPattern3.ts (8 errors) ====
    function a(...[a = 1, b = true]: string[]) { }
                   ~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
                          ~
!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
    
    function b(...[...foo = []]: string[]) { }
                          ~
!!! error TS1186: A rest element cannot have an initializer.
    
    function c(...{0: a, length, 3: d}: [boolean, string, number]) { }
                                 ~
!!! error TS2493: Tuple type '[boolean, string, number]' of length '3' has no element at index '3'.
    
    function d(...[a, , , d]: [boolean, string, number]) { }
                          ~
!!! error TS2493: Tuple type '[boolean, string, number]' of length '3' has no element at index '3'.
    
    function e(...{0: a = 1, 1: b = true, ...rest: rest}: [boolean, string, number]) { }
                      ~
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.
                                ~
!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
                                                   ~~~~
!!! error TS2566: A rest element cannot have a property name.