www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5392] New: Method with template this parameter doesn't work as a property

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

           Summary: Method with template this parameter doesn't work as a
                    property
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: doob me.com



The following code fails to compile:

class A
{
    T foo (this T) ()
    {
        return new T;
    }
}

class B : A { }

void main ()
{
    auto b = new B;
    B b2 = b.foo;
}

With the error message:
main.d(16): Error: b.foo(this T) has no value

This code works:

auto b2 = b.foo; // using auto
B b2 = b.foo(); // using parentheses

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 30 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5392


Stanislav Blinov <stanislav.blinov gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stanislav.blinov gmail.com



14:44:11 PST ---
Similar things have been reported before, though I'm not sure how close the
relation is:

http://d.puremagic.com/issues/show_bug.cgi?id=4501
http://d.puremagic.com/issues/show_bug.cgi?id=2691

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 30 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5392


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

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



Works in 2.060head.

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