-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Issue 3659 & others - Relax opEquals signature #373
Conversation
|
The requires line says phobos but points to druntime.git ! Also you probably mean 'stub' not 'stab'. |
|
Thanks for your pointing out, yebblies! |
|
This now seems to be causing a linker failure. |
|
@yebblies |
|
If this works for you then it's probably a problem with having another version of phobos on the linker path. I'll have a look, it wouldn't be the first time. |
|
Yep, using the wrong dmd.conf. Should be correct the run after next. |
It needs druntime fix, adding bool _xopEquals(in void*, in void*) into object.d When xopEquals should throw Error on runtime, that function pointer is used.
Issue 3659 & others - Relax opEquals signature
| @@ -1,7 +1,5 @@ | |||
|
|
|||
| import core.vararg; | |||
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.
Removal of this import broke this test on 64 bit platforms
Add a function for reconnect in TcpSocket, used by server high performance socket programming
http://d.puremagic.com/issues/show_bug.cgi?id=3659
requires: druntime git://github.com/9rnsr/druntime.git relax_opEquals_sig
Points:
Remove opEquals signature restriction.
We can define any signatures of
opEquals, even if it is template funciton.Make stub for TypeInfo_Struct.xopEquals
(Needs druntime fix, see Supplemental changes of dmd/pull/373 druntime#70)
TypeInfo.equalsgets two lvalue throughin void*.So we should make stub for calling user
opEquals.// If user opEquals is qualified const, and gets ref const S, and returns bool,
// we can set its function pointer to xopEquals directly.
// But it is not yet implemented.
If this stub couldn't compile, stub code is replaced with follows:
TypeInfo.equalsshould not break both objects constness, so we cannot callthe
opEqualsthat breaks objects constness. Instead throwsErrorat runtime.If no user opEquals (and need opEquals definition), compiler builds following opEquals automatically.
const bool opEquals(const S rhs) { ... }
This signature can receive rvalue of S, and const copy of lvalue.