www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7103] New: the -property switch vs. template functions with default template arguments

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

           Summary: the -property switch vs. template functions with
                    default template arguments
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: webby beardmouse.org.uk



PST ---
if you compile the following code using the DMD 2.057 beta, using the -property
switch, then you get no warning or error.

/////////////////////////////////////////////////
import std.stdio;

struct duck
{
    void quack(int I1, int I2 = 0)(bool louder = false)
    {
        if (louder)
            writeln("QUACK");
        else
            writeln("quack");
    }
}

void main()
{
    duck d;
    d.quack!(0);
}
/////////////////////////////////////////////////

However, if you change it to

    d.quack!(0, 0);

then you get

    Error: not a property d.quack

Shouldn't both cases behave the same?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 13 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7103


Ellery Newcomer <ellery-newcomer utulsa.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ellery-newcomer utulsa.edu



20:41:59 PDT ---
dmd 2.060 both versions get you

Error: not a property d.quack

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