Skip to content

Add a test case related to spreading objects - #57642

Merged
Ryan Cavanaugh (RyanCavanaugh) merged 1 commit into
microsoft:mainfrom
Andarist:tests/spread-no-circular
Mar 4, 2024
Merged

Add a test case related to spreading objects#57642
Ryan Cavanaugh (RyanCavanaugh) merged 1 commit into
microsoft:mainfrom
Andarist:tests/spread-no-circular

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

test case for #48178
it was fixed by #53413

@typescript-botTypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Mar 4, 2024
@typescript-bot

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh) merged commit 0f6f7c3 into microsoft:mainMar 4, 2024
@jakebailey

Copy link
Copy Markdown
Member

#53413 shouldn't have fixed anything, so I do wonder what the heck I did...

@Andarist

Copy link
Copy Markdown
ContributorAuthor

Jake Bailey (@jakebailey) the circularity was caused by subtype reduction - ur PR avoids it in certain cases and thus it accidentally~ fixed this issue

@Andarist

Copy link
Copy Markdown
ContributorAuthor

I re-checked and at the time the circularity was encountered by the subtype reduction we can see those types when we get to your optimization:

typeToString(getTypeOfSymbol(leftProp))// Foo | BoxtypeToString(rightType)// Foo | Box | undefined

So it makes sense that we don't get to the circularity now since u avoid that subtype reduction based on this check:

result.links.type=leftTypeWithoutUndefined===rightTypeWithoutUndefined ? leftType : getUnionType([leftType,rightTypeWithoutUndefined],UnionReduction.Subtype);

I'd call it - "accidental but good" :P

@Andarist
Mateusz Burzyński (Andarist) deleted the tests/spread-no-circular branch March 5, 2024 07:25
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Andarist@typescript-bot@jakebailey@RyanCavanaugh