-
-
Notifications
You must be signed in to change notification settings - Fork 742
Issue 12668 - std.traits.functionAttributes should use the new getFunctionAttributes trait. #2131
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
I've left the |
Ah I've just realized I can use a CTFE function with a static foreach. Edit: Updated to use CTFE. |
Did you notice it's failing? |
|
Derp. I saw it the first time, and then forgot about it :/ |
DMD pull was merged. Awaiting review & green on this one. |
Seems like it is now failing at the unittest stage. |
Gonna investigate. Strange because it worked a few days ago locally.. something must have changed. |
It appears the old |
property = 1 << 3, /// ditto | ||
trusted = 1 << 4, /// ditto | ||
safe = 1 << 5, /// ditto | ||
nogc = 1 << 6, /// ditto |
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 reason why I've left nogc
here instead of moved it somewhere else (which would have made the order nicer with [trusted, safe, system]), is because I want to keep backwards compatibility if any code ever stored nogc
as a uint
field somewhere (it's might be rare, but I don't want to introduce hard to track bugs).
I need to fixup |
Updated. Hopefully it should pass now, locally it works. |
Ah interesting, there's some |
getFunctionAttributes trait.
I've added a workaround. @9rnsr: You probably wrote that |
LGTM, but the any subtlety here could have gone over my head. In particular: Is I guess the question is really for the |
Hum... struct S
{
void foo() {}
void bar() @system {}
}
void main()
{
pragma(msg, typeof(S.foo).stringof);
pragma(msg, typeof(S.bar).stringof);
}
Now I'm even more confused. Seems that Given the above test, it seems inconsistent that your tests pass: static assert(functionAttributes!(S.noF) == FA.system);
static assert(functionAttributes!(typeof(S.noF)) == FA.system); I think there is an inconsistency here between what the actual attributes are, and what attributes get mangled in the name? |
I see... |
Auto-merge toggled on |
Looks good and latest auto-tester results look green |
Issue 12668 - std.traits.functionAttributes should use the new getFunctionAttributes trait.
Thanks. |
https://issues.dlang.org/show_bug.cgi?id=12668
This requires dlang/dmd#3506 before it will pass the autotester.