www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5426] New: Property syntax fails with template function with template paramters but no function parameters and you have a setter

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

           Summary: Property syntax fails with template function with
                    template paramters but no function parameters and you
                    have a setter
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: jmdavisProg gmx.com



PST ---
This fails to compile:

struct S
{
     property T func(T)()
    {
        return T.init;
    }

     property void func(T)(T value)
    {
    }
}

void main()
{
    S s;
    auto t = s.func!int;
    s.func!int = 2;
}

and it gives this error:

l.d(16): Error: template instance func!(int) matches more than one template
declaration, l.d(3):func(T) and l.d(8):func(T)


If you use s.func!int(), it works. If you make it so that the setter function
is no longer a property function, and you don't actually try and use the
setter, then it works (though if you the try and use the non-property setter
function, the property getter fails again). So, it looks like the property
syntax is definitely broken for template which have a template parameter but no

sure that they're the same bug (since 5425 deals with a situation which works
normally but not inside __traits).

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


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com



PDT ---
Compiles and runs with 2.059 win32.

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             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
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5426


Jacob Carlborg <doob me.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |doob me.com



Awesome!

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