[Issue 10574] New: "auto ref" fails to match when IFTI succeeds (strip to level const)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 8 10:05:37 PDT 2013


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

           Summary: "auto ref" fails to match when IFTI succeeds (strip to
                    level const)
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: monarchdodra at gmail.com


--- Comment #0 from monarchdodra at gmail.com 2013-07-08 10:05:36 PDT ---
Basically, an "immutable(int[])" will not match "auto ref T[]", when it does
match "T[]".

Example:

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

version(all)
{
    void foo(T)(auto ref T[] i)
    {
        writeln(typeof(i).stringof);
    }
}
else
{
    void foo(T)(T[] i)
    {
        writeln(typeof(i).stringof);
    }
    void foo(T)(ref T[] i)
    {
        writeln(typeof(i).stringof);
    }
}

void main()
{
    immutable(int[]) i;
    foo(i);
}
//--------

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


More information about the Digitalmars-d-bugs mailing list