-
Notifications
You must be signed in to change notification settings - Fork 648
Add handling for 2-3 invalid overload candidates #1098
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
base: main
Are you sure you want to change the base?
Conversation
I said this in #1097 (comment) but I'm not 100% certain that this particular thing was a bug. Note how much more text the old compiler had to complain about roughly the same thing. |
Though moving the error lines is not super great. Not sure why this change is needed exactly, given I would have expected the overload error to be placed in the same place but... |
Moving the lines is the problematic thing for us because it invalidates our existing I think that specific linked issue could be fixed by applying these lines in the case of 2 or 3 overload errors, with a comment explaining that it's done to be backwards-compatible with existing error placement. Making this change needn't prohibit you simplifying this behaviour and/or changing error-reported lines in TypeScript 7.1+, but matching the existing typechecker's error output reduces the conformances diffs to make meaningful differences stand out more while the port is getting its finishing touches. |
I do agree that the errors moving is a problem. If this is intentional (I believe so, based on past discussions), perhaps what we should do instead is port this into 5.9. To be clear, the positioning of errors is not really a guaranteed thing. In your case, I would really suggest not using |
Fixes #1088 by adding back the 2-3 override arg code.
The overload descriptions in errors seem wonky still (they're adding "new (..." in a bunch of places but I don't think that's touched in the specific code here