www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1369] New: Unable to find 'this' in __traits(getMember)

reply d-bugmail puremagic.com writes:
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"))();


-- 
Jul 24 2007
next sibling parent d-bugmail puremagic.com writes:
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



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: -------
Dec 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
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



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: -------
Jan 09 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1369





 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: -------
Jan 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1369




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


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: -------
Feb 17 2013
prev sibling parent d-bugmail puremagic.com writes:
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: -------
Feb 17 2013