File: noImplicitAnyDestructuringVarDeclaration.types

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 (48 lines) | stat: -rw-r--r-- 922 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
37
38
39
40
41
42
43
44
45
46
47
48
=== tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration.ts ===
var [a], {b}, c, d; // error
>a : any
>b : any
>c : any
>d : any

var [a1 = undefined], {b1 = null}, c1 = undefined, d1 = null; // error
>a1 : any
>undefined : undefined
>b1 : any
>null : null
>c1 : any
>undefined : undefined
>d1 : any
>null : null

var [a2]: [any], {b2}: { b2: any }, c2: any, d2: any;
>a2 : any
>b2 : any
>b2 : any
>c2 : any
>d2 : any

var {b3}: { b3 }, c3: { b3 }; // error in type instead
>b3 : any
>b3 : any
>c3 : { b3: any; }
>b3 : any

var [a4] = [undefined], {b4} = { b4: null }, c4 = undefined, d4 = null; // error
>a4 : any
>[undefined] : [undefined]
>undefined : undefined
>b4 : any
>{ b4: null } : { b4: null; }
>b4 : null
>null : null
>c4 : any
>undefined : undefined
>d4 : any
>null : null

var [a5 = undefined] = []; // error
>a5 : any
>undefined : undefined
>[] : []