D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15562 - scope parameter doesn't work
Summary: scope parameter doesn't work
Status: RESOLVED DUPLICATE of issue 6931
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-13 02:15 UTC by mzfhhhh
Modified: 2020-03-21 03:56 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description mzfhhhh 2016-01-13 02:15:17 UTC
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 basile-z 2016-01-15 04:14:22 UTC
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 ***