From 1e8a7e28d00734578098255705b646269aa52f2e Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 18 Feb 2016 09:13:18 -0800 Subject: [PATCH] Correct && operator to produce nullable values --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7d7290b9031..6a95162804a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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: