www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9041] New: "Need 'this' to access member" of inner class in typeid

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

           Summary: "Need 'this' to access member" of inner class in
                    typeid
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: freeslave93 gmail.com



The following code generates error "need 'this' to access member b"

import std.stdio;

class B
{

}

class A
{
    B b;
}

int main(string[] args)
{
    static assert(is(typeof( {A a = new A; writeln(typeid(a.b));}))); //pass

    //same but out of static assert
    A a = new A;
    writeln(typeid(a.b)); //error
    return 0;
}

But it's ok if we replace class B with struct.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 17 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9041


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

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



07:12:24 PDT ---
The pull in Issue 11010 fixes this.

*** This issue has been marked as a duplicate of issue 11010 ***

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