Thread overview
[Issue 1369] New: Unable to find 'this' in __traits(getMember)
Jul 24, 2007
d-bugmail
Dec 01, 2012
Andrej Mitrovic
Jan 09, 2013
Andrej Mitrovic
Jan 22, 2013
Kenji Hara
Feb 18, 2013
Kenji Hara
July 24, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1369

           Summary: Unable to find 'this' in __traits(getMember)
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: reiner.pope@gmail.com


the following code fails to compile.
class Foo
{
    Bar impl;

    void foo()
    {
        __traits(getMember, impl, "func")(); // line 7
    }

}

class Bar { void func() { } }

---
The error occurs on line 7: "need 'this' to access member impl"

The code compiles if you replace line 7 with

__traits(getMember, this.impl, "func")();

or

(mixin("impl.func"))();


-- 

December 01, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=1369


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-12-01 15:50:54 PST ---
The error is now worse:

test.d(8): Error: type Bar is not an expression

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
           Platform|x86                         |All
            Version|2.000                       |D2
         AssignedTo|nobody@puremagic.com        |andrej.mitrovich@gmail.com
         OS/Version|Windows                     |All


--- Comment #2 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-01-09 15:31:01 PST ---
https://github.com/D-Programming-Language/dmd/pull/1454

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



--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2013-01-21 20:14:05 PST ---
(In reply to comment #2)
> https://github.com/D-Programming-Language/dmd/pull/1454

New pull request: https://github.com/D-Programming-Language/dmd/pull/1530

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



--- Comment #4 from github-bugzilla@puremagic.com 2013-02-17 18:47:38 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/38bacc17f25b32f41411cb5a1e6b087431073779 fix Issue 1369 - getMember doesn't work for variables in aggregates

https://github.com/D-Programming-Language/dmd/commit/6925db01b364e5e053066bf48f73d2b2e7e11632 Merge pull request #1530 from 9rnsr/fix1369

Issue 1369 - getMember doesn't work for variables in aggregates

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


Kenji Hara <k.hara.pg@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: -------