[Issue 882] New: associative arrays with TypeInfo keys are broken for	user defined types
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Wed Jan 24 05:47:26 PST 2007
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=882
           Summary: associative arrays with TypeInfo keys are broken for
                    user defined types
           Product: D
           Version: 1.00
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Phobos
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: thomas-dloop at kuehne.cn
# typedef short A;
# typedef float B;
# 
# void main(){
#    TypeInfo[TypeInfo] aa;   printf("len:%d\n", aa.length);
#    aa[typeid(A)] = null;   printf("len:%d\n", aa.length);
#    aa[typeid(B)] = null;   printf("len:%d\n", aa.length);
# }
output:
> len:0
> len:1
> len:1
Using primitive types the results are as expected:
# void main(){
#    TypeInfo[TypeInfo] aa;   printf("len:%d\n", aa.length);
#    aa[typeid(short)] = null;   printf("len:%d\n", aa.length);
#    aa[typeid(float)] = null;   printf("len:%d\n", aa.length);
# }
output:
> len:0
> len:1
> len:2
-- 
    
    
More information about the Digitalmars-d-bugs
mailing list