http://d.puremagic.com/issues/show_bug.cgi?id=5862
Summary: case statement allows runtime values
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Keywords: accepts-invalid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Andrej Mitrovic <[email protected]> 2011-04-19
13:22:50 PDT ---
int foo(ref int y)
{
y = 5;
return y;
}
void main()
{
int x = 1;
int y = 2;
switch (x = foo(y))
{
case y: // <- should not be allowed
writeln("x == y");
default:
}
assert(x == 5);
assert(y == 5);
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------