diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 05dbd47006b..304e77271a7 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -580,6 +580,9 @@ namespace ts { case SyntaxKind.BinaryExpression: bindBinaryExpressionFlow(node); break; + case SyntaxKind.DeleteExpression: + bindDeleteExpressionFlow(node); + break; case SyntaxKind.ConditionalExpression: bindConditionalExpressionFlow(node); break; @@ -1055,6 +1058,13 @@ namespace ts { } } + function bindDeleteExpressionFlow(node: DeleteExpression) { + forEachChild(node, bind); + if (node.expression.kind === SyntaxKind.PropertyAccessExpression) { + bindAssignmentTargetFlow(node.expression); + } + } + function bindConditionalExpressionFlow(node: ConditionalExpression) { const trueLabel = createBranchLabel(); const falseLabel = createBranchLabel(); diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index fa8004a5d91..f9b84e857dd 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7563,6 +7563,8 @@ namespace ts { return checkRightHandSideOfForOf((parent).expression) || unknownType; case SyntaxKind.BinaryExpression: return getAssignedTypeOfBinaryExpression(parent); + case SyntaxKind.DeleteExpression: + return undefinedType; case SyntaxKind.ArrayLiteralExpression: return getAssignedTypeOfArrayLiteralElement(parent, node); case SyntaxKind.SpreadElementExpression: