TypeScript/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.types
2014-08-15 14:37:48 -07:00

25 lines
793 B
Plaintext

=== 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: any) => any
>a || ((a) => a.toLowerCase()) : (a: any) => any
>a : (a: string) => string
>((a) => a.toLowerCase()) : (a: any) => any
>(a) => a.toLowerCase() : (a: any) => any
>a : any
>a.toLowerCase() : any
>a.toLowerCase : any
>a : any
>toLowerCase : any