Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Change TypeInfo.next to inout function #359

Merged
merged 3 commits into from
Mar 6, 2013
Merged

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Nov 28, 2012

In 2.060, following code has changed to not to work.

TypeInfo ti = typeid(SomeType);
while (ti.next) { ti = ti.next; }
// ti.next now returns const(TypeInfo), then rebinding is rejected.

This change fixes the problem.

@alexrp
Copy link
Member

alexrp commented Nov 28, 2012

Fails on Darwin32 due to a compiler bug...

@MartinNowak
Copy link
Member

Locate TypeInfo_Vector after TypeInfo_AssociativeArray

Why?

@MartinNowak
Copy link
Member

The OSX32 bug happens when compiling rt.lifetime and I've reduced it to this.

cat > bug.d << CODE
void bug()
{
    auto sizeelem = typeid(int).next.tsize;
}
CODE

dmd -c -m32 -O -release -inline bug.d

@MartinNowak
Copy link
Member

OK, it's an unrelated bug Bugzilla 9096.

@alexrp
Copy link
Member

alexrp commented Jan 11, 2013

Does this still fail on OS X?

@MartinNowak
Copy link
Member

Does this still fail on OS X?

Yes, the problem is related to the inout addition.
A workaround was to simply use the following.

auto ti = typeid(int).next;
auto sizeelem = ti.tsize;

But accessing a TypeInfo field of a return type or an array element is pretty common, so merging this pull without fixing Bugzilla 9096 first might break a lot of code.

Bug 9231 has already fixed, so attribute inference now works correctly with inout method.
@9rnsr
Copy link
Contributor Author

9rnsr commented Mar 6, 2013

By removing workaround for bug 9231, the symptom of bug 9096 is now disappeared. But I don't know why that...

@alexrp
Copy link
Member

alexrp commented Mar 6, 2013

Well... I suppose we can merge this then.

alexrp added a commit that referenced this pull request Mar 6, 2013
Change TypeInfo.next to inout function
@alexrp alexrp merged commit ff0ff7a into dlang:master Mar 6, 2013
@andralex
Copy link
Member

andralex commented Mar 6, 2013

@9rnsr: if we have a passing unittest for bug 9096, then you may want to close it as resolved.

@9rnsr
Copy link
Contributor Author

9rnsr commented Mar 6, 2013

@andralex Sorry, I don't know whether the bug 9096 is resolved. It had fortunately just gone from the test result for this pull.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants