File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -3024,13 +3024,16 @@ namespace ts {
3024
3024
typeForObject = typeChecker . getContextualType ( < ObjectLiteralExpression > objectLikeContainer ) ;
3025
3025
existingMembers = ( < ObjectLiteralExpression > objectLikeContainer ) . properties ;
3026
3026
}
3027
- else {
3027
+ else if ( objectLikeContainer . kind === SyntaxKind . ObjectBindingPattern ) {
3028
3028
// We are *only* completing on properties from the type being destructured.
3029
3029
isNewIdentifierLocation = false ;
3030
3030
3031
3031
typeForObject = typeChecker . getTypeAtLocation ( objectLikeContainer ) ;
3032
3032
existingMembers = ( < BindingPattern > objectLikeContainer ) . elements ;
3033
3033
}
3034
+ else {
3035
+ Debug . fail ( "Expected object literal or binding pattern, got " + objectLikeContainer . kind ) ;
3036
+ }
3034
3037
3035
3038
if ( ! typeForObject ) {
3036
3039
return false ;
You can’t perform that action at this time.
0 commit comments