2014-07-13 01:04:16 +02:00
|
|
|
//// [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]
|
2014-08-12 00:54:12 +02:00
|
|
|
// 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.
|
2014-07-13 01:04:16 +02:00
|
|
|
var a;
|
2014-08-12 00:54:12 +02:00
|
|
|
// bug 786110
|
2014-07-13 01:04:16 +02:00
|
|
|
var r = a || (function (a) { return a.toLowerCase(); });
|