D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6773 - inout variable should not be modifiable
Summary: inout variable should not be modifiable
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid, patch
Depends on:
Blocks:
 
Reported: 2011-10-05 15:53 UTC by Kenji Hara
Modified: 2011-10-06 14:44 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2011-10-05 15:53:50 UTC
inout(int) foo(inout(int) x)
{
    x = 5;  // cannot modify inout
    return 0;
}

inout(T) variable is treated like const(T), then it is not modifiable.