object.di: Rename TypeInfo_Const.next to TypeInfo_Const.base. #1182
Conversation
Could someone explains what is going on here? The original |
I'm very much in favor of this change, see also https://issues.dlang.org/show_bug.cgi?id=3806 and https://issues.dlang.org/show_bug.cgi?id=8656. See https://github.com/D-Programming-Language/druntime/blob/master/src/rt/aaA.d#L696 for the usual dance to support both object.d and object.di. |
Next is a virtual member function in TypeInfo, so the |
I guess you'll have to change the test to |
This explains the test case failure somehow, but why does |
druntime is compiled with object.d on the command line, so it does not import object.di. |
Cool. If I run
then I get the error
I try to change the failing test. |
So if I understand this correctly, I think we need at least an alias to Is there a reason not to just change |
That's possible, but it makes for a horrible API. The meaning of
|
That looks more like a bug than something that is done intentionally... |
Yes, but someone might still have used it. To avoid silent change, we might want to add
to TypeInfo_Const for some tme. |
I just notice that TypeInfo_Delegate and TypeInfo_Function have the same issue. They don't use different identifiers, but just redeclare |
As a random question, why do we need |
That's an old separation to hide implementation details. It's still a bit relevant because object is imported by every D code, but we might reconsider if it's still necessary. |
You need to fix this dmd test to make it pass. |
This is really broken. The problem is that On the other hand https://github.com/D-Programming-Language/dmd/blob/714d1b32cfe721e6266ebbc096355c8ce109f8b8/test/runnable/testtypeid.d#L439 requires the With my changes it now passes all Phobos unit tests and the mentioned dmd test. |
Better solution is to change rt.lifetime. See dlang#1182 for more info. Fixes failing test runnable/testtypeid.d
I think |
@@ -1225,7 +1225,7 @@ class TypeInfo_Const : TypeInfo | |||
override @property size_t tsize() nothrow pure const { return base.tsize; } | |||
override void swap(void *p1, void *p2) const { return base.swap(p1, p2); } | |||
|
|||
override @property inout(TypeInfo) next() nothrow pure inout { return base.next; } | |||
override @property inout(TypeInfo) next() nothrow pure inout { return base; } |
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'm not sure this is a desired change, at least it might break more code.
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.
Yes can you please undo that.
This is used e.g. in rt.lifetime, function unqualify.
I removed the change to But I still think that the |
I think you can remove the additional calls to unqualify in
There is no strict definition of what |
I guess this is obsolete now that we are always using object_.d to begin with. |
This is used e.g. in
rt.lifetime
, functionunqualify()
.