File: logicalOrExpressionIsNotContextuallyTyped.symbols

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (20 lines) | stat: -rw-r--r-- 1,068 bytes parent folder | download | duplicates (5)
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.es5.d.ts, --, --))
>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 9, 15))
>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --))