File: logicalOrExpressionIsNotContextuallyTyped.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 (24 lines) | stat: -rw-r--r-- 844 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
=== tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrExpressionIsNotContextuallyTyped.ts ===
// The || operator permits the operands to be of any type.
// If the || expression is not contextually typed, the right operand is contextually typed
// by the type of the left operand and the result is of the best common type of the two
// operand types.


var a: (a: string) => string;
>a : (a: string) => string
>a : string

// bug 786110
var r = a || ((a) => a.toLowerCase());
>r : (a: string) => string
>a || ((a) => a.toLowerCase()) : (a: string) => string
>a : (a: string) => string
>((a) => a.toLowerCase()) : (a: string) => string
>(a) => a.toLowerCase() : (a: string) => string
>a : string
>a.toLowerCase() : string
>a.toLowerCase : () => string
>a : string
>toLowerCase : () => string