mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-16 06:28:12 -05:00
Remove equality check for contextual types
This commit is contained in:
@@ -28088,7 +28088,7 @@ namespace ts {
|
||||
// literal handle it instead.
|
||||
if (contextualTypeHasPattern) {
|
||||
const rootPatternParent = findAncestor(contextualType.pattern!.parent, n => n.kind === SyntaxKind.VariableDeclaration || n.kind === SyntaxKind.BinaryExpression || n.kind === SyntaxKind.Parameter);
|
||||
const spreadOrOutsideRootObject = findAncestor(node, n => n === rootPatternParent || (n.kind === SyntaxKind.SpreadAssignment && getContextualType(n.parent as Expression, /*contextFlags*/ undefined)!.pattern === contextualType.pattern))!;
|
||||
const spreadOrOutsideRootObject = findAncestor(node, n => n === rootPatternParent || (n.kind === SyntaxKind.SpreadAssignment))!;
|
||||
|
||||
if (spreadOrOutsideRootObject.kind !== SyntaxKind.SpreadAssignment) {
|
||||
for (const prop of getPropertiesOfType(contextualType)) {
|
||||
|
||||
Reference in New Issue
Block a user