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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 25 08:51:53 PST 2014


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 at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at 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: -------


More information about the Digitalmars-d-bugs mailing list