[Issue 2483] New: DMD allows assignment to a scope variable
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Dec 1 10:58:02 PST 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2483
Summary: DMD allows assignment to a scope variable
Product: D
Version: 1.037
Platform: PC
OS/Version: Windows
Status: NEW
Keywords: accepts-invalid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: snake.scaly at gmail.com
The specs at http://www.digitalmars.com/d/1.0/attribute.html#scope say:
"Assignment to a scope, other than initialization, is not
allowed." Nevertheless, the following code compiles:
void main()
{
scope Object foo;
foo = new Object;
}
Tested this in DMD 1.037, DMD 2.021, 2.019 and 1.033.
--
More information about the Digitalmars-d-bugs
mailing list