www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8972] New: foreach fails on __traits(getOverloads) in a struct member function

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

           Summary: foreach fails on __traits(getOverloads) in a struct
                    member function
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: samukha voliacable.com



PST ---
struct A
{
    void foo() {}

    void connect()
    {
        foreach (overload; __traits(getOverloads, typeof(this), "foo"))
        {
        }
    }
}

Error: variable test.A.connect.overload cannot be declared to be a function

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


Max Samukha <samukha voliacable.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|foreach fails on            |__traits fails in a struct
                   |__traits(getOverloads) in a |member function
                   |struct member function      |



PST ---
Changed the title since the bug is not specific to foreach or getOverloads.
Related to http://d.puremagic.com/issues/show_bug.cgi?id=8971

Another test case:

template Tuple(A...)
{
    alias A Tuple;
}

struct A
{
    void foo() {}

    void connect()
    {
    alias Tuple!(__traits(getOverloads, typeof(this), "foo")) overloads;        
    }
}

Error: expression this.foo is not a valid template value argument

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid
           Severity|normal                      |regression



The bug cause is same as bug 8771, so this is also a regression.

https://github.com/D-Programming-Language/dmd/pull/1268

Max, thanks to your report. When I fixed bug 8971, I had completely forgotten
the case for struct member function.

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




PST ---
No problem. Thanks for your efforts.

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




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/66756c6d2d109680682b61e0e2c8e6de6215f960
fix Issue 8972 - __traits fails in a struct member function

https://github.com/D-Programming-Language/dmd/commit/7d39d577ab0120d64a073c2513d966c8a150f022


Issue 8972 - __traits fails in a struct member function

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


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |FIXED


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