www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - classinfo bugs

I'm sure you're aware of these, but I thought I'd post them anyway:

D:\code\d>type test.d
import std.stdio;


void print( TypeInfo ti )
{
writefln( ti.classinfo.base.name, ": ", ti.classinfo.name );
}


int main()
{
class C {}
struct S {}

print( typeid( char ) );
print( typeid( wchar ) );
print( typeid( dchar ) );
print( typeid( char[] ) );
print( typeid( wchar[] ) );
print( typeid( dchar[] ) );
print( typeid( C ) );
print( typeid( char* ) );
print( typeid( S ) );
return 0;
}

D:\code\d>test
TypeInfo: TypeInfo_a
TypeInfo: TypeInfo_u
TypeInfo: TypeInfo_w
TypeInfo: TypeInfo_Aa
TypeInfo: TypeInfo_Au
TypeInfo: TypeInfo_Aw
TypeInfo: TypeInfoClass
Object: TypeInfo
Object: TypeInfo

Apparent bugs:

- classinfo for wchar and dchar is reversed
- classinfo for pointers and structs is broken
- shouldn't classinfo.base for pointers and structs have type TypeInfo, not
Object?
Aug 06 2004