Correct && operator to produce nullable values

This commit is contained in:
Anders Hejlsberg 2016-02-18 09:13:18 -08:00
parent 54ee0b13b3
commit 1e8a7e28d0

View File

@ -11260,7 +11260,7 @@ namespace ts {
case SyntaxKind.InKeyword:
return checkInExpression(left, right, leftType, rightType);
case SyntaxKind.AmpersandAmpersandToken:
return rightType;
return isNullableType(leftType) ? getNullableType(rightType) : rightType;
case SyntaxKind.BarBarToken:
return getUnionType([getNonNullableType(leftType), rightType]);
case SyntaxKind.EqualsToken: