-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make removeSubtypes resilient to reentry #3071
Conversation
@@ -3572,7 +3572,18 @@ module ts { | |||
return false; | |||
} | |||
|
|||
// Since removeSubtypes checks the subtype relation, and the subtype relation on a union | |||
// may attempt to reduce a union, it is possible that removeSubtypes could be called | |||
// recursively on the same set of types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a future reader, this comment might leave them thinking "and...?"
Explain further that the stack is used to detect when subtype reduction is currentlytaking place for a given union type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Since removeSubtypes checks the subtype relation, and the subtype relation on a union
// may attempt to reduce a union, it is possible that removeSubtypes could be called
// recursively on the same set of types. The removeSubtypesStack is used to track which
// sets of types are currently undergoing subtype reduction.
…into removeSubtypesRecursion
2425310
to
7a92282
Compare
Since we have a tendency to add related tests with similar names, in the future suffix test names with 👍 |
Make removeSubtypes resilient to reentry
Fixes #2997