File: contextuallyTypingOrOperator2.types

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (33 lines) | stat: -rw-r--r-- 1,040 bytes parent folder | download | duplicates (7)
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
=== tests/cases/compiler/contextuallyTypingOrOperator2.ts ===
var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 };
>v : { a: (_: string) => number; }
>a : (_: string) => number
>_ : string
>{ a: s => s.length } || { a: s => 1 } : { a: (s: string) => number; }
>{ a: s => s.length } : { a: (s: string) => number; }
>a : (s: string) => number
>s => s.length : (s: string) => number
>s : string
>s.length : number
>s : string
>length : number
>{ a: s => 1 } : { a: (s: string) => number; }
>a : (s: string) => number
>s => 1 : (s: string) => number
>s : string
>1 : 1

var v2 = (s: string) => s.length || function (s) { s.aaa };
>v2 : (s: string) => number | ((s: any) => void)
>(s: string) => s.length || function (s) { s.aaa } : (s: string) => number | ((s: any) => void)
>s : string
>s.length || function (s) { s.aaa } : number | ((s: any) => void)
>s.length : number
>s : string
>length : number
>function (s) { s.aaa } : (s: any) => void
>s : any
>s.aaa : any
>s : any
>aaa : any