-
-
Notifications
You must be signed in to change notification settings - Fork 667
DIP29: implicit conversion of pointer expressions #3319
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
|
Just ignore the testCols.d thing, it's just that damned CRLF problem again that git thinks is different but is not. |
test/runnable/implicit.d
Outdated
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 line will make an invalid pointer. I think we should avoid any undefined behaviors even in trivial test cases, if it's not intended.
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.
Done.
|
Note that, CRLF fix for testCols.d is already done #3307 in git head.so just you can remove the commit. |
src/cast.c
Outdated
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.
Should be static?
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.
Alternatively, change this to return void and use t and result member 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.
made it static
Great, but I have no idea how to do that. |
|
|
@yebblies that worked like a champ! You da man! |
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.
Why tail immutable instead of full immutable? The immutableness of the head shouldn't make any difference here...
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.
Either way works, but I wished to make it clear that what matters with pointer conversions is what is pointed to, not the pointer itself.
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.
I don't think this is clearer. Put that note in a comment instead of complicating the code (and making it slower).
|
I should add that this should work like a pure function: |
Only when |
|
Should have a bugzilla report, not just a DIP. |
|
Sorry, should be: @yebblies , the last time everyone said it should be a dip. |
Having a DIP is great, but you still need a bugzilla entry for the changelog. |
|
Looks good. |
|
Auto-merge toggled on |
DIP29: implicit conversion of pointer expressions
This implements implicit conversions of (ptr+offset) expressions so that the ptr part determines if the expression is implicitly convertible.
This is a reboot of #1700
http://wiki.dlang.org/DIP29