-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
Implement DIP1035 - system variables #14478
Conversation
|
Thanks for your pull request and interest in making D better, @dkorpel! 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 referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#14478" |
2d26a02
to
f6b065d
Compare
| @@ -542,6 +542,11 @@ extern (C++) abstract class Declaration : Dsymbol | |||
| return (storage_class & STC.future) != 0; | |||
| } | |||
|
|
|||
| final extern(D) bool isSystem() const pure nothrow @nogc @safe | |||
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.
Please update the header
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.
It's extern(D), do you think it should be exposed to the extern(C++) interface?
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.
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.
Nope, extern(D) does not need to be exposed to other backends.
|
It's currently red because of deprecations when compiling druntime/phobos caused by dlang/druntime#3007 which paints not only functions now, but also constants and variables |
f6b065d
to
19f47cf
Compare
722e238
to
323d60f
Compare
323d60f
to
93af21c
Compare
93af21c
to
7fd6100
Compare
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.
A list of suggestions and questions:
- declaring @System variable in a while/if condition and then using it should be tested.
- declaring @System parameters for functions should be tested
- is it allowed to take the address of a @System variable in @safe code? Anyway, a test with this should be added.
- is it allowed to pass a @System variable to a @safe function?
- should we add a trait similar to getFunctionAttributes which gets the attributes of a variable since we now have attributes for variables?
- if you can declare a system parameter, is it possible to declare a template function that receives a system parameter?
| @@ -22,7 +22,6 @@ version (linux): | |||
| extern (C): | |||
| nothrow: | |||
| @nogc: | |||
| @system: | |||
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.
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.
This may apply to some of the other files as well.
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.
Not allowed by the grammar
Not allowed by the grammar No, then you access it
Okay Only if you're calling it from a
Probably, but not in this PR
You can't, and you can't |
|
@RazvanN7 Anything else? |
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.
Looks good to me, however, I would prefer if @WalterBright merges this.
6d89653
to
baf7354
Compare
baf7354
to
105c50a
Compare

Make access of variables with
STC.systema deprecation/error depending on-preview=systemVariables.Does not implement inference of
@systembased on initializers yet, or checking againstvoidinitializing / array casting.