25 lines
844 B
Plaintext
25 lines
844 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: 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
|
|
|