Skip to content

Commit 422a405

Browse files
Documentative and conservative checking.
1 parent 4a2e672 commit 422a405

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/services/services.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3024,13 +3024,16 @@ namespace ts {
30243024
typeForObject = typeChecker.getContextualType(<ObjectLiteralExpression>objectLikeContainer);
30253025
existingMembers = (<ObjectLiteralExpression>objectLikeContainer).properties;
30263026
}
3027-
else {
3027+
else if (objectLikeContainer.kind === SyntaxKind.ObjectBindingPattern) {
30283028
// We are *only* completing on properties from the type being destructured.
30293029
isNewIdentifierLocation = false;
30303030

30313031
typeForObject = typeChecker.getTypeAtLocation(objectLikeContainer);
30323032
existingMembers = (<BindingPattern>objectLikeContainer).elements;
30333033
}
3034+
else {
3035+
Debug.fail("Expected object literal or binding pattern, got " + objectLikeContainer.kind);
3036+
}
30343037

30353038
if (!typeForObject) {
30363039
return false;

0 commit comments

Comments
 (0)