Bug 15562 – scope parameter doesn't work

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2016-01-13T02:15:17Z
Last change time
2020-03-21T03:56:36Z
Assigned to
No Owner
Creator
mzfhhhh

Comments

Comment #0 by mzfhhhh — 2016-01-13T02:15:17Z
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); }
Comment #1 by b2.temp — 2016-01-15T04:14:22Z
https://issues.dlang.org/show_bug.cgi?id=6931 actually the problem is that it's accepted but it's a noop. *** This issue has been marked as a duplicate of issue 6931 ***