Skip to content
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

Merged
merged 3 commits into from
May 7, 2015

Conversation

JsonFreeman
Copy link
Contributor

Fixes #2997

@@ -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.
Copy link
Member

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.

Copy link
Contributor Author

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.

@DanielRosenwasser
Copy link
Member

Since we have a tendency to add related tests with similar names, in the future suffix test names with 01.

👍

JsonFreeman added a commit that referenced this pull request May 7, 2015
Make removeSubtypes resilient to reentry
@JsonFreeman JsonFreeman merged commit e1d0515 into release-1.5 May 7, 2015
@JsonFreeman JsonFreeman deleted the removeSubtypesRecursion branch May 7, 2015 22:41
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants