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
|
|
|
|
|
|
|
|
// bug 786110
|
|
|
|
var r = a || ((a) => a.toLowerCase());
|
2015-01-10 00:10:32 +01:00
|
|
|
>r : (a: string) => string
|
|
|
|
>a || ((a) => a.toLowerCase()) : (a: string) => string
|
2014-08-15 23:33:16 +02:00
|
|
|
>a : (a: string) => string
|
2015-01-10 00:10:32 +01:00
|
|
|
>((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
|
|
|
|