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.
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.
I thought it was the reverse: The variance check may cause a typecheck to pass (positive) where the structural check would fail (negative)
#32664 (comment)
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.
See #33020 and the associated issue for variance checks raising errors where a structural comparison would not.
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.
Hmm, I'm just confused because that seemingly contradicts the conversion I had with @weswigham (linked in my post above).
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.
In particular:
Which sounds like it shouldn't be able to cause an error only based on the variance result.
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.
Also (I'm done after this I promise):
Implying that any false negatives will be discarded in favor of the structural result.
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.
My reading:
The marker indicates that negative results are unreliable, therefore structural checks are used in the event of failure.
The positive results are assumed to be reliable such that false positives do not occur, even if in reality they can. There is no fallback in the event of success.
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 guess when I hear "false positive" I think of, e.g. a virus scanner reporting a virus where none exists; likewise the
unreliablevariance can produce a successful typecheck where the canonical one (structural) would fail. We thus seem to be seeing the "positive" and "negative" from opposite sides of the fence, hence the confusion 😄Reverse polarity! ➕ <--> ➖