16 lines
517 B
JavaScript
16 lines
517 B
JavaScript
|
//// [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;
|
||
|
|
||
|
// bug 786110
|
||
|
var r = a || ((a) => a.toLowerCase());
|
||
|
|
||
|
//// [logicalOrExpressionIsNotContextuallyTyped.js]
|
||
|
var a;
|
||
|
var r = a || (function (a) { return a.toLowerCase(); });
|