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
Trust variance checking during identity checking #30903
Trust variance checking during identity checking #30903
Conversation
@ahejlsberg thoughts on which should go into 3.4.4 (or both?) |
73ab894
to
0923a7c
Compare
With #30877 the typesafe-joi project compiles successfully:
With #30877 plus the bail out that always trusts variances with identity relations it gets slightly better:
However, using this PR (i.e.
So, my take is that #30877 should go in, possibly with the bail out that always trusts variance checks. I don't think we want this PR. |
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 don't think this PR is ready for prime time as per my comments above.
#30416 essentially improves the same core area as this, so I'm going to close this. |
This reverts the substantive change in #30877 in favor of an alternative fix that simply makes identity checking more efficient in many cases by always using the "variance" result, if present (I mentioned this in the comments in that PR),
We always used to do this until 3.4 where we realized variance checking was often inaccurate, and made it a fast path for the
true
case, but still fell back to structural checking - that change is ultimately what broketypesafe-joi
. By retaining that behavior for identity checking, we retain our old performance characteristics there.