Thread overview
[Issue 9442] New: typeid() doesn't work without `this.` for class fields
Feb 02, 2013
Andrej Mitrovic
Feb 02, 2013
Kenji Hara
Feb 03, 2013
Benjamin Thaut
Feb 04, 2013
Andrej Mitrovic
February 02, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9442

           Summary: typeid() doesn't work without `this.` for class fields
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: andrej.mitrovich@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-02-01 16:51:14 PST ---
class C
{
    this()
    {
        auto x = typeid(c);  // L5 NG
        auto y = typeid(this.c);  // ok
    }

    C c;
}

void main() { }

$ test.d(5): Error: need 'this' to access member c

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 02, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9442


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2013-02-01 23:57:08 PST ---
https://github.com/D-Programming-Language/dmd/pull/1595

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 03, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9442


Benjamin Thaut <code@benjamin-thaut.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code@benjamin-thaut.de


--- Comment #2 from Benjamin Thaut <code@benjamin-thaut.de> 2013-02-03 05:47:59 PST ---
There is a workaround:

typeid(typeof(this.c));

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



--- Comment #3 from github-bugzilla@puremagic.com 2013-02-04 00:36:40 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c589ba59462f1609da564723a90a72b920ab8483 fix Issue 9442 - typeid() doesn't work without `this.` for class fields

https://github.com/D-Programming-Language/dmd/commit/aa51dadc917ccd844fb4f30a456b9fb40f316694 Merge pull request #1595 from 9rnsr/fix9442

Issue 9442 - typeid() doesn't work without `this.` for class fields

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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