-
-
Couldn't load subscription status.
- Fork 655
Issue 12228 & Issue 13943 - Deprecate usage of 'this' and 'super' as types #8242
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
Conversation
|
Thanks for your pull request, @JinShil! 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#8242" |
|
@CyberShadow, can you please advise on why DAutoTest is failing while others are passing? |
|
Could be due to a difference in the DMD version used to compile DMD (DAutoTest is trying to build the DMD source documentation at the point where it fails). Does the error message make sense to you? If it's an easy fix, it might as well be done, to avoid unnecessarily restraining the range of versions that DMD can be built with. |
Somewhat. I did modify those lines, but it appears that the compiler being used to build the documentation has a bug.
So DAutoTest is using 2.067.1? Is that necessary? Can it be upgraded? |
src/dmd/typesem.d
Outdated
| //printf("TypeIdentifier::resolve(sc = %p, idents = '%s')\n", sc, mt.toChars()); | ||
| if ((mt.ident.equals(Id._super) || mt.ident.equals(Id.This)) && !hasThis(sc)) | ||
| { | ||
| // @@@DEPRECATED_2019-05@@@. |
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.
The new deprecation DIP suggests to use versions instead.
|
I'm looking into this. BTW, any plans to deprecate/remove calling static methods via instances? Or at least |
Is there an bug/issue report? |
|
Sorry, I don't know. It's a very long standing pain point (since D 1.x). |
File a bug report, get @WalterBright or @andralex to approve it, and if I can understand it and it's within my ability, I'll implement it. |
|
Found the issue. DAutoTest and related software will use 2.079.0 once #8112 is merged (see #8112 (comment)). However, that PR is still not merged, so the old default (2.067.1) remains in force. There are a few ways to proceed:
I would obviously prefer one of the first two :) |
AFAICT that's a feature by design. I at least remember Walter defending this a few months ago as it allows for more generic code.
Not sure even this will be easy. |
|
Being able to forbid non-static calls in a contract would work too. |
|
Will wait on #8112 or alternative. |
Yes, it's deliberate. Removing it would require a compelling argument. |
The reason I asked is that I ran into a problem caused by it when trying to implement reference-counted classes. The problem occurs when the wrapped class defines In the end I had to move all construction to factory functions because of this issue. Do you know a better solution? |
|
DAutoTest has been updated. This PR is ready to go. |
|
There's a slight problem with this: https://issues.dlang.org/show_bug.cgi?id=18976 |
This is also a followup to #8141