Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm not understanding how the function would previously return
truefor the wildcard type (which is aTypeFlags.Any)? What am I missing?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.
The place I was referring to was inferTypes, which starts with a wildcard check, but if both sides are a wildcard we loop forever.
But, it checks for "could contain type var" before the wildcard logic.
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.
Right, but assuming both sides are wildcard types, how is it that we loop forever? That would require
couldContainTypeVariablesto returntruefor aTypeFlags.Any, and I'm not seeing how that happens.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.
You're totally right that
couldContainTypeVariablesshould already be returningfalseforwildcardType, and yet, in my example it appeared to be returning true in the debugger!But now, on main, my test doesn't fail... reverse bisecting says that it was "fixed" by changing
lib.d.ts. So, I think there's some really odd corruption happening. Sounds like a fun debugging challenge.This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Just to note the scary thing I'm seeing:
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.
Traced this down to the new code in #53246, but it's absolutely bizarre. The flag is clearly there that says that "could contain type vars" is computed, and yet it still proceeds to overwrite it for no reason.
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.
Figured it out, see #54348 (comment)