www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - typeinfo for structs, enums, typedefs, arrays

reply "Carlos Santander B." <carlos8294 msn.com> writes:
I'm not sure to put it as a bug, but more as a request.

The following code:

/////////////
void foo ( ... )
{
    foreach ( TypeInfo ti ; _arguments )
        ti.print();
}

void main ()
{
    A a;
    B b;
    my_int m;
    aliased_int i;
    E e;
    char [] [ char [] ] aa;
    Object [] oa;
    int [] ia;
    char [] s;
    foo(a,b,m,i,e,aa,oa,ia,s);
}

class A {}

struct B {}

typedef int my_int;

alias int aliased_int;

enum E { x }
/////////////

Produces this output:

A
TypeInfo
TypeInfoTypedef
int
TypeInfo
TypeInfo
TypeInfo
TypeInfo_Ai
char[]

Could it be possible to get proper TypeInfo for arrays, structs, typedefs
and enums. Probably for aliases it's ok the way it's now, but I'm not
totally sure. Also notice how "char[]" is printed but "int[]" is not.

-----------------------
Carlos Santander Bernal
Jun 30 2004
parent "Walter" <newshound digitalmars.com> writes:
Yes, I plan to improve on the TypeInfo support.
Jul 02 2004