www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3915] New: typeid not getting type of offsetof standard property

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3915

           Summary: typeid not getting type of offsetof standard property
           Product: D
           Version: 2.041
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: crimson.magus gmail.com


--- Comment #0 from Aldo Nunez <crimson.magus gmail.com> 2010-03-09 11:43:00
PST ---
The expressions typeid( SS.b.offsetof ) and typeid( ss3.b.offsetof ) fail with
the error "no property 'offsetof' for type 'char'".

Using typeof in between makes them work, as in typeid( typeof( SS.b.offsetof )
). Changing "offsetof" to "sizeof" also works.

Here's the sample program:

import std.stdio;

struct SS
{
    char a;
    char b;
}

void main()
{
    SS ss3;
    ss3.a = 'A';
    ss3.b = 'L';

    writeln( SS.b.offsetof );
    //writeln( typeid( SS.b.offsetof ) );      // error

    writeln( ss3.b.offsetof );
    //writeln( typeid( ss3.b.offsetof ) );     // error

    writeln( typeid( typeof( SS.b.offsetof ) ) );
    writeln( typeid( typeof( ss3.b.offsetof ) ) );
}

This problem looks related to bugs #3643 and 1684.
But this one is about not getting the type of the "offsetof" standard property.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 09 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3915


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |WORKSFORME


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-02-04
18:48:05 PST ---
Works in 2.061.

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