-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
fix issue 18149 - Add a compiler trait to detect if a function is @disable #7569
Conversation
Thanks for your pull request, @bbasile! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. Bugzilla references
|
Is there any particular reason why UPDATE: I see that once a function is marked with |
Yes. This and also it'd be for the |
I'm itching to approve this, but before then it needs a changelog entry in this PR and a documentation update at https://github.com/dlang/dlang.org. |
@JinShil, a changelog entry is not needed. An issue is referenced so it would appear even without. |
Yes, I know, and I generally agree, but I've been asked to add changelog entries for certain Bugzilla issues, even though they appear in list of fixed issues. The following are examples: This is a new feature and I think it is appropriate to do some advertising for it. |
We have had examples of both adding a dedicated changelog entry and relying on Bugzilla (e.g. https://dlang.org/changelog/2.078.0.html#bugfix-list - @RazvanN7 can you add a changelog entry for |
Okay i 've just added the changelog entry and the good news is that this has revealed that the trait is much more useful than i thought. |
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.
Thanks @bbasile. I'm going to leave this open for a little while to give others an opportunity to weigh in.
Yes this is a language change and thus needs approval from either @WalterBright or @andralex. |
src/dmd/declaration.d
Outdated
@@ -417,6 +417,11 @@ extern (C++) abstract class Declaration : Dsymbol | |||
return (storage_class & STCdeprecated) != 0; | |||
} | |||
|
|||
final bool isDisabled() |
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.
Add const pure nothrow @nogc @safe
changelog/disabled-trait.dd
Outdated
using `__trait(compiles)`, which was less than ideal since `false` could be | ||
returned for other reasons. | ||
|
||
Now, in your metaprogramming code, `@disable` functions can be detected accurately, |
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.
Remove your
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.
see my comments
@WalterBright Are you willing to explicitly mark this "Approved"? |
@bbasile Please rebase. It won't elicit any reviews unless it's passing. |
What do you mean by this? I don't see any merge conflicts and only auto-tester has one spurious failure, but auto-tester automatically invalidates and restarts all jobs if at any repo a PR is merged to master. @WalterBright needs to dismiss his review (I could do that as well, but I'm not sure he explicitly approved the addition). |
It appears this code is using |
Ah I see. Though we can easily do that and reduce the latency / "ping-pong" time ;-) |
(I just rebased this PR) |
Looks like there's a regression under OSX 32 bits, that happened between the 2018-01-10 22:21:41 and the 2018-01-10 11:23:11. |
Can we please stop spending precious dev time and stalling PRs to support this dead platform? |
Oh that's interesting. It looks similar to what @marler8997 is experiencing. |
Looking at the logs it is the same issue. I was able to reproduce on my macbook pro and got a stack trace. Note that this seg fault only occurs because the autotester is using dmd version 2.068.2, I was able to fix the problem on my macbook by using the next version, 2.069.0. Here's the stack trace, maybe we should consider patching dmd 2.068.2?
|
P.S. I worked around the issue by adding some printf statements to a certain locations in the code :) It was hours of painstaking trial and error to massage the code to not cause the segfault. Tedious work, but no one else is going to do it for me. |
reminder: I do not define the supported platforms. I only implement them and remind people when they want them changed for whatever reason that those changes must go through the community and leadership team. I'm part of the former but not the latter. So, go, get approval for changing the supported platform set. |
@wilzbach, circle ci here too doesn't work anymore, although it used to. I did rebase or amend several times yesterday and it's not triggered anymore (as for semaphore). |
Interesting that that only happens with your account, but it seems like closing & reopening worked here... |
Recently i revoked circle-ci from my account...but i don't think this could be the cause. |
It could also be related to the partial GitHub outage a couple of days ago: |
Although there's not much concrete application (since a call to a
@disable
function is already statically checked) for now there is no way to know if a function is@disable
.