www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11994] New: typeof(this) in constraint of member function template should reflect method qualifier

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

           Summary: typeof(this) in constraint of member function template
                    should reflect method qualifier
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg gmail.com> 2014-01-25 08:51:50 PST ---
With 2.064:

bool printType(T, size_t ln = __LINE__)()
{
    pragma(msg, T.stringof);
    return true;
}
struct S
{
    void foo()() const
    if (printType!(typeof(this)))
    {}

    const void bar()()
    if (printType!(typeof(this)))
    {}
}
void main()
{
    S s;
    s.foo();    // const(S)
    s.bar();    // S
}

Both of s.foo() and s.bar() should print const(S)

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 25 2014
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11994


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

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


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2014-01-25 09:04:13 PST ---
Merge into the regression issue 11993.

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

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