www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15562] New: scope parameter doesn't work

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 puremagic.com
          Reporter: mzfhhhh 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);
}

--
Jan 12