According to Phobos object docs:
uint flags();
Get flags for type: 1 means GC should scan for pointers
This is implemented correctly.
import std.stdio;
void main() {
writefln(typeid(uint).flags & 1); //0
writefln(typeid(uint*).flags & 1); //1
writefln(typeid(void*).flags & 1); //1
writefln(typeid(float).flags & 1); //0
}
However, source code to setTypeInfo:
void setTypeInfo(TypeInfo ti, void* p)
{
if (ti.flags() & 1)
hasNoPointers(p);
else
hasPointers(p);
}
The if statement in this code is clearly backwards.
Comment #1 by dsimcha — 2009-01-25T22:15:37Z
No longer relevant to D2, but should still be fixed in D1.
Comment #2 by github-bugzilla — 2012-04-25T01:43:15Z