-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Fix(15506) - Disallow non-any/number/string operands on comparisons #56666
base: main
Are you sure you want to change the base?
Conversation
…ntain spread syntax (microsoft#56372) Co-authored-by: Nathan Shively-Sanders <[email protected]>
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
@microsoft-github-policy-service agree |
The TypeScript team hasn't accepted the linked issue #15506. If you can get it accepted, this PR will have a better chance of being reviewed. |
This last commit fixes the Self Check action error by allowing compare |
I would expect that we would be recursing into those types to verify, and not ignore them. I'm pretty sure we have this sort of checking for other operators, so it feels weird that we are adding a whole new function to check this... |
Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @mjbvz, @zkat, and @joj for you. Feel free to loop in other consumers/maintainers if necessary. |
Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page. Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up. |
Just some updates, I've searched for checkers that could make this comparison but I couldn't find it, so basically what I did was start using this The Self Check error will come back now and after fixing the This last push brings a lot from the main branch with it, not sure if I'm doing something wrong here. |
It seems like you incorrectly merged main, I'm afraid. |
Sorry about that, I did a reset on my 875169e commit, but if you think it's a better idea to open another PR I can do that too. |
So I've worked to fix some of the self-check errors, most of them were related to Date comparisons so I started using But I'm not sure how to go on this last error: |
How is this PR different from #52807?
|
I don't think they are, they look the same to me. In that case, it's a better idea to just close this current PR? |
Maybe; #52807 did not mention #15506 but was instead in the context of better handling |
Fixes #15506 :
This PR aims to fix the #15506 ticket, here I based myself on previous PRs (and suggestions) that tried to resolve this same issue in the past (so I would say that it was co-authored by @feloy and @FabianLauer).
From what I understand, the main idea is that we should flag an error on every comparison (
<
,>
,<=
and>=
) that is not between astring
,number
, orany
types. Doing this, triggered a lot of new errors on the baselines (that seem correctly triggered assuming that I understand the issue correctly), but I would like to confirm that I got this right because it seems like a huge change to me.I'm submitting the PR as a spike for now, just to gather suggestions, understand if this still a desired change and confirm that I'm following the right path here since this issue is kinda old and this is my first time contributing here.