http://d.puremagic.com/issues/show_bug.cgi?id=9172
Summary: strange shadowing declaration check
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Alexander Tankeev <[email protected]> 2012-12-17 12:56:47
PST ---
DMD64 D Compiler v2.060
---{ testcase.d }---
import std.random;
void main()
{
if ( uniform(0,1) )
for(uint i=0; i < 1; i++)
if ( uniform(0,1) ) {}
else
for(uint i=0; i < 1; i++)
if ( uniform(0,1) ) {}
}
------{ EOF }-------
# rdmd testcase.d
testcase.d(8): Error: shadowing declaration testcase.main.i is deprecated
---{ testcase.d }---
import std.random;
import std.stdio;
void main()
{
if ( uniform(0,1) )
for(uint i=0; i < 1; i++)
writeln(1);//if ( uniform(0,1) ) {}
else
for(uint i=0; i < 1; i++)
writeln(2);//if ( uniform(0,1) ) {}
}
------{ EOF }-------
# rdmd testcase.d
2
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------