[Issue 15562] New: scope parameter doesn't work

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jan 12 18:15:17 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15562

          Issue ID: 15562
           Summary: scope parameter doesn't work
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: mzfhhhh at foxmail.com

int[] globalSlice;
int[] foo(scope int[] parameter)
{
    globalSlice = parameter; // ← compilation OK now
    return parameter; // ← compilation OK now
}
void main()
{
    int[] slice = [ 10, 20 ];
    int[] result = foo(slice);
}

--


More information about the Digitalmars-d-bugs mailing list