Fix Issue 8161 - deprecate invalid property function definitions#8320
Fix Issue 8161 - deprecate invalid property function definitions#8320ntrel wants to merge 3 commits intodlang:masterfrom
Conversation
|
Thanks for your pull request and interest in making D better, @ntrel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#8320" |
|
I'm not sure if this is a good idea because I'm not sure what we want to do with |
d56d303 to
f177634
Compare
|
@jacob-carlborg I'm not aware of any plans for |
Add error for void getter or aggregate setter method with 2 params.
|
Currently |
wilzbach
left a comment
There was a problem hiding this comment.
No matter how our plans for @Property are, I think it's more than reasonable to forbid invalid cases like @Property getters which return void and show a better error message, so I like this idea.
BTW a potential DIP is here: dlang/DIPs#97
Though I think we should update the spec to match the compiler error.
|
Looks like this would need a deprecation period though: |
That should be a given 😊. |
This indicates template code where void has been substituted for a type.
FWIW we typically use |
|
Personally, I don't think that we should do anything with First, we need to decide what we're actually going to do with |
Removing |
Personally, I think that that aspect of But regardless, the point is that Once that decision has been made, then maybe these changes will fit in with that wonderfully, and we can have these extra checks on |
If @WalterBright and @andralex believe This PR helps users employ
Yes, @ntrel, please add a spec update to ensure these new enforcements are properly documented. |
What feature? Basically all it does is affect the result of |
This PR will actually help with the uncertainty surrounding |
Not really. It's just breaking some of them now rather than later - and that's assuming that we're even going to do anything with |
|
Honestly, I think that this is one of those cases where @WalterBright just needs to weigh in. If he's fine with adding these checks, then okay, but otherwise, they shouldn't go in. They're mucking around with an incomplete and pseudo-canceled feature, so they're really more in DIP territory rather than a bug fix or simple improvement that we clearly want. |
No, it wasn't decided, because that phantom decision that you claim exists is not currently reflected in the documentation. If you want any of that hearsay to hold water, it needs to be officially added somewhere in the documentation.
No. It's forcing people to change their currently incorrect
It's not unimplemented. It's partially implemented. And this PR provides enforcement for that part which is implemented.
I would prefer that too, but @WalterBright and @andralex rarely weigh in on these little things. And, until they do, and their decision is somehow reflected in the documentation,
No. Deprecating |
No, that pull just affected |
|
@WalterBright @andralex @atilaneves Gentlemen, the mail is far overdue on @Property. Request a discussion amongst yourselves and a formal decision made regarding the fate of this non-feature. Seven years is way more than enough time to make a decision. It's far better to kill it than to remain utterly indecisive about it. |
|
@AndrewEdwards you can't kill property without breaking code using typeof. Breaking D2 code with no error for previously correct code is unacceptable. |
|
@ntrel, point taken. In your opinion, what is the correct/acceptable solution moving forward? Is that to find a solution to improve |
|
I opt to finished this implementation as @andralex still uses the property code in the druntime recently. Property needs a major code overall here to be useful as c# properties. |
|
@WalterBright @andralex @atilaneves Gentlemen, your input is requested. |
FYI: most people have GitHub notifications turned off as there's too much noise. So please don't assume that your pings will reach people. For certainty, old-school email is required. |
|
I always get notifications if I'm pinged. In this instance I'll defer to @WalterBright |
|
@Property is more or less a failure. But I don't want to break peoples' code that uses it in good faith. I recommend not doing anything with @Property, document properly what it does now, and recommend people not use it for new code. Fixing problems with it like this PR both breaks existing code and appears to encourage new code to be written with it. |
|
I see andralax write new code using @Property in the druntime. I hate it to see it in a half bake state with no attempts to fix it. |
|
@12345swordy You mean the typeinfo stuff? I think it was more to stay in keeping with the existing code. Not to worry about. |
|
Real talk, why can't we just mark @Property as deprecate with no remove date? I want actual c# like properties here. |
|
IMHO the best way (and the obvious first step) is to marginalize in the documentation. |
|
CC @WalterBright @andralex @atilaneves @ntrel In order to summarize my understanding fully. The decision is made to: To move forward we will need to update the content of the following pages: @wilzbach @jmdavis, request your assistance in making this happen. Once completed, this pull request will be closed. |
|
Feel free to close this pull. I don't see any good argument for deprecating |
|
There's nothing I can do here, hence I unassigned myself. This needs a decision from leadership. If it's decided to deprecate @Property, I'm happy to help. |
|
As mentioned, there's no clear path for property. If a champion comes with a proper plan, timeline, and way to manage breakage, great. In the meantime, let's leave it be, there are bigger fish to fry. |
Add error for void getter or aggregate setter method with 2 params.