File: logicalOrExpressionIsNotContextuallyTyped.symbols

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (20 lines) | stat: -rw-r--r-- 1,060 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
=== 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 : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 6, 3))
>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 6, 8))

// bug 786110
var r = a || ((a) => a.toLowerCase());
>r : Symbol(r, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 9, 3))
>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 6, 3))
>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 9, 15))
>a.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))
>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 9, 15))
>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))