[Issue 5835] New: Class array's TypeInfo.getHash doesn't work correctly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 11 05:56:15 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5835

           Summary: Class array's TypeInfo.getHash doesn't work correctly
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2011-04-11 05:52:31 PDT ---
Sample code:
----
import std.stdio;
class Foo{
  hash_t toHash(){ writeln("Foo.toHash"); return 0; }
}
void main(){
  Foo[] arr = [new Foo(), new Foo()];
  typeid(arr).getHash(&arr);  // doesn't call Foo.toHash()
}
----

The typeid(arr) returns instance of TypeInfo_Array, but its getHash is not call
Object.toHash of each element.

The internal TypeInfo class rt.typeinfo.ti_AC.TypeInfo_AC supports it, but this
is only used in array/associative-array operations.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list