[Issue 217] New: typeof not working properly in internal/object.d

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 22 11:19:19 PDT 2006


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

           Summary: typeof not working properly in internal/object.d
           Product: D
           Version: 0.161
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: sean at f4.ca


This bug appears related to the special handling DMD seems to have for
compiling the object.d implementation file: internal/object.d.  If the version
blocks used to generate size_t and ptrdiff_t aliases (ie. lines 48-73) are
removed and replaced by the more flexible aliases used in the global object.d
header file:

    alias typeof(int.sizeof) size_t;
    alias typeof(cast(void*)0 - cast(void*)0) ptrdiff_t;
    alias size_t hash_t;

Then attempting to rebuild Phobos will generate these errors:

\bin\dmd\bin\dmd -c -O -release -nofloat -w internal\object.d
internal\object.d(388): function object.memcpy (void*,void*,typeof(4u)) does
not match argument types (ubyte*,void*,uint)
internal\object.d(388): cannot implicitly convert expression (sz) of type uint
to typeof(4u)
internal\object.d(389): function object.memcpy (void*,void*,typeof(4u)) does
not match argument types (void*,void*,uint)
internal\object.d(389): cannot implicitly convert expression (sz) of type uint
to typeof(4u)
internal\object.d(390): function object.memcpy (void*,void*,typeof(4u)) does
not match argument types (void*,ubyte*,uint)
internal\object.d(390): cannot implicitly convert expression (sz) of type uint
to typeof(4u)
internal\object.d(537): function object.memcmp (void*,void*,typeof(4u)) does
not match argument types (void*,void*,uint)
internal\object.d(537): cannot implicitly convert expression (this.xsize) of
type uint to typeof(4u)
internal\object.d(555): function object.memcmp (void*,void*,typeof(4u)) does
not match argument types (void*,void*,uint)
internal\object.d(555): cannot implicitly convert expression (this.xsize) of
type uint to typeof(4u)

--- errorlevel 1

I can't reproduce this elsewhere so I'm marking this bug as low priority, but
it should probably be fixed at some point.


-- 




More information about the Digitalmars-d-bugs mailing list