TypeScript/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.types

25 lines
844 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== 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
2014-08-15 23:33:16 +02:00
// 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
2014-08-15 23:33:16 +02:00