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
allow ref on locals, globals, and statics #16428
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request, @WalterBright! 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#16428" |
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.
are these such ref
s implicitly scope
? if not should they be? Also this needs a changelog entry
Yes. |
Good to hear. Please add a |
c0e8beb
to
828b0cf
Compare
done. |
3aa3fdd
to
93446d1
Compare
Cybershadow/DAutoTest gives no indication why it failed. |
As always , scroll to the bottom and work your way back up:
|
@thewilsonator I did scroll through it, but did not see that message, lost in the thousands of lines of output. Thanks for finding it for me! |
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.
What about (ref i) { ref r = i; ... }
- is the declaration of r
an error?
@ntrel it's the same as the way |
c36e4d1
to
543387e
Compare
@ntrel it's the same behavior as:
|
This is ready to go now. |
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 changelog makes it sound like the DIP was already accepted. Should we wait with merging or word is as a preview feature?
We should wait, the DIP has not even been submitted, let alone reviewed by the wider community. |
That's what https://www.digitalmars.com/d/archives/digitalmars/dip/development/First_Draft_ref_For_Variable_Declarations_74.html is for. |
@@ -0,0 +1,14 @@ | |||
`ref` can now be applied to local, static, extern, and global variables | |||
|
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 the [DIP](https://github.com/WalterBright/documents/blob/master/varRef.md). | |
@@ -0,0 +1,14 @@ | |||
`ref` can now be applied to local, static, extern, and global variables |
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 DIP says:
This DIP is for declaring local variables as ref. Not globals, statics, externs, __gshareds or fields.
Implementation of the proposal discussed in the n.g.:
https://www.digitalmars.com/d/archives/digitalmars/dip/development/First_Draft_ref_For_Variable_Declarations_74.html