File: noImplicitAnyDestructuringParameterDeclaration.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-- 1,189 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/noImplicitAnyDestructuringParameterDeclaration.ts ===
function f1([a], {b}, c, d) { // error
>f1 : ([a]: [any], { b }: { b: any; }, c: any, d: any) => void
>a : any
>b : any
>c : any
>d : any
}
function f2([a = undefined], {b = null}, c = undefined, d = null) { // error
>f2 : ([a]: [any?], { b }: { b?: any; }, c?: any, d?: any) => void
>a : any
>undefined : undefined
>b : any
>null : null
>c : any
>undefined : undefined
>d : any
>null : null
}
function f3([a]: [any], {b}: { b: any }, c: any, d: any) {
>f3 : ([a]: [any], { b }: {    b: any;}, c: any, d: any) => void
>a : any
>b : any
>b : any
>c : any
>d : any
}
function f4({b}: { b }, x: { b }) { // error in type instead
>f4 : ({ b }: {    b;}, x: {    b;}) => void
>b : any
>b : any
>x : { b: any; }
>b : any
}
function f5([a1] = [undefined], {b1} = { b1: null }, c1 = undefined, d1 = null) { // error
>f5 : ([a1]?: [any], { b1 }?: { b1: any; }, c1?: any, d1?: any) => void
>a1 : any
>[undefined] : [undefined]
>undefined : undefined
>b1 : any
>{ b1: null } : { b1: null; }
>b1 : null
>null : null
>c1 : any
>undefined : undefined
>d1 : any
>null : null
}