rename TypeInfo's init method to initializer #1403
Conversation
I'm not sure, has 2.069 already been branched? I'm assuming it has, i.e. this PR would go into 2.070 (or later). |
Well, we have quite the problem here. I don't know how often In addition, when adding a new symbol that replaces an older one, it's generally better to not deprecate the old one for at least one release so that those who do keep up with the releases are able to build their code with both master and the latest release without getting any deprecation messages. However, in this particular case, we're talking about renaming a virtual function. Anyone who's deriving anything from I don't see any sane way to do this which doesn't break code very quickly. It could be done in several steps (e.g. starting by adding |
41bd0ae
to
3caa1c4
Compare
And in my opinion, this is what they deserve from trying to derive from In all seriousness, this is not a problem I think we should worry about. Usage of I don't understand the 2 year period, that seems like a long time. I was thinking 2 or 3 releases. |
In this case, that may be okay, because As it is, Walter freaked out when he updated one of his projects a while back and functions that his program used were gone - and they had been deprecated for at least two years before being removed. I suspect that he and Andrei would prefer that we never remove deprecated symbols - which wouldn't work in this case anyway, but in general, I don't like that plan, because it leaves cruft in the library along with more symbol conflicts. We've had a two year deprecation cycle for a while now in order to minimize the risk of anyone having their code break without ever seeing any deprecation warnings. It used to be shorter, but there was complaining about that (from Andrei in particular IIRC). And for the most part, two years has been working quite well (if anything, it's sometimes longer when I miss something that should be moved along through the deprecation cycle). You don't have a lot of excuse if you haven't updated your code in two years. So, if we are only doing two or three releases of deprecation, then that's an exception to how we normally function. We've done that from time to time, but usually not. I don't know how long would be appropriate in this case, but it would probably be okay to make it shorter given how rare it likely is for code to be messing with |
Ping? Where do we stand on this? If this needs to follow a slower schedule, please advise. |
IMO, we should do this, but you need to at least include an alias from |
3caa1c4
to
0d1d1ba
Compare
|
d56ea6f
to
6448525
Compare
Had that already.
Ok, updated the PR. Here's the new, slower plan (also in the changelog and in the source):
|
I'm good with the plan, but I think @jmdavis says 2 years. Given the not-often-followed-but-we're-getting-better release process, this puts it at about 8 months (a release every 2 months) before complete removal. He did say it's "probably ok" for this. Possibly the only improvement would be 2 releases with both active (i.e. deprecate in 2.072), so that there is a larger window in which one can change their code and have it compile for those on older compilers. This is especially important for those on the lagging compilers (ldc/gdc). Anyway, nice job updating the changelog. |
6448525
to
9c3ec20
Compare
Updated the plan in that way. I.e.:
For review: in the changelog, and in the source. |
Sounds like an OKish plan to me. |
It comes up in generic code, e.g. as |
I see, let's do it then. Lying around to long already and it should only affect people that know how to deal with it anyhow. |
Looks good. It's difficult to figure this out manually, but (and perhaps you've already done this) can you enable the |
I think that's how I found the instances. Hadn't done phobos, though. Done now: dlang/phobos#3846. Also ran the druntime tests with |
OK, thanks, @MartinNowak did you review the code? If so, I'll pull, or you can. |
Looks like a merge issue with the changelog. |
"init" clashes with the type property of the same name. Adding an alias called "init" to give people a chance to update their code. Further deprecation plan: * 2.071: Do nothing. Keep both init and initializer functional for a while. * 2.072: Deprecate the alias. * 2.073: Replace the alias with an `@disable`d method. * 2.074: Remove the init method, fixing issue 12233.
9c3ec20
to
0470021
Compare
rebased |
Ping? I'd like to get this into 2.070. |
I'll pull. |
Auto-merge toggled on |
rename TypeInfo's init method to initializer
TypeInfo_Class.init is deprecated and removed from the runtime (since .init clashes with the type property of the same name). This uses `initializer()` method which is the new way of accessing the same thing in D2. dlang/druntime#1403 dlang/druntime#1766 dlang/druntime#1807 https://issues.dlang.org/show_bug.cgi?id=15037 https://issues.dlang.org/show_bug.cgi?id=12233
TypeInfo_Class.init is deprecated and removed from the runtime (since .init clashes with the type property of the same name). This uses `initializer()` method which is the new way of accessing the same thing in D2. dlang/druntime#1403 dlang/druntime#1766 dlang/druntime#1807 https://issues.dlang.org/show_bug.cgi?id=15037 https://issues.dlang.org/show_bug.cgi?id=12233
"init" clashes with the type property of the same name.
Adding a deprecated alias called "init" to give people a chance to
update their code. Planning to remove the alias in 2.071 to fix issue
12233.
https://issues.dlang.org/show_bug.cgi?id=15037https://issues.dlang.org/show_bug.cgi?id=12233