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

           Summary: Escaping references to variardic parameter array are
                    not properly checked
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Maxim Fomin <[email protected]> 2013-02-17 07:44:54 PST 
---
import std.stdio;

class A
{
    int[] array;
    this(int[] array...) 
    {
        this.array = array;
    }
}

A a;

int[] foo(int[] array ...) 
{
    //return array; //Error: escaping reference to variadic parameter array
    a.array = array;
    return a.array;
}

int[] bar() 
{
    return foo(1,2,3);
}

void main()
{
    A a = new A(2,3);
}

This should issue two errors: in A ctor and in foo();

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

Reply via email to