-
Notifications
You must be signed in to change notification settings - Fork 358
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
Remove preprocessing of backwards-compatibility code #5508
Conversation
b8b59b5
to
50ed571
Compare
What are you trying to achieve with this? I disagree with this at the very least |
The idea is to get rid of preprocessing altogether (which would make it easier for e.g. Merlin). I don't see how this is a regression, since both before and after this PR |
Ah nevermind sorry, I hadn't noticed the order of inclusion in
Looking at the code I'm wondering if we really need this new
|
@kit-ty-kate You're right, I've been thinking too complicated, simplified it now. The only place where I need an additional |
@kit-ty-kate Through your simplifications the |
We don't really need for The current state of the PR is rather nice and it simplifies things a bit. However something that's a bit annoying is that it doesn't really cover for typos.
To me that's not important, it's actually better to not have them so we can detect which compatibility functions we actually have/use easier. |
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.
One thing that's also missing now is a way to know from a glance, which functions to remove when we'll eventually raise the minimum required version of OCaml in a few years.
Maybe a simple comment like this would be enough?
Co-authored-by: Kate <[email protected]>
True, but it is only a problem in the |
First of all, I do appreciate this PR. Minor nit: I'd put the version comment (as well) in the implementation, not only the interface (since that's where merlin pushes you). Another minor comment: I dislike warning numbers, and since (actually since when?) OCaml supports as well |
This is only applicable since OCaml 4.13 so for the three cases we have here it would probably work but in the general case it wouldn't. |
I would've assumed Merlin can pull these comments from the interface as well? Maybe if we marked them as doc-comments. But I think it is no harm and possibly useful to add them in the implementation as well, added that.
A shame because I really liked the idea (and share Hannes' dislike for the arbitrary numbers). Well at least now I know this is possible going forward in 4.13. |
Thanks |
This PR attempts to completely remove preprocessing code via the use of shadowing. It works on 4.14, let's see if it works on older versions as well.