Thread overview | |||||
---|---|---|---|---|---|
|
August 23, 2006 [Issue 305] New: version and static if blocks introduce new scope for 'scope' statement | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=305 Summary: version and static if blocks introduce new scope for 'scope' statement Product: D Version: 0.165 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: sean@f4.ca According to the documentation for version blocks, "no new scope is introduced, even if the DeclarationBlock or Statement is enclosed by { }." And the docs for static if say "it does not introduce a new scope even if { } are used for conditionally compiled statements." However, this code: void main() { version( all ) { scope( exit ) printf( "version exit\n" ); } static if( true ) { scope( exit ) printf( "if exit\n" ); } printf( "main\n" ); } Produces this output: version exit if exit main When I expect: main if exit version exit -- |
August 25, 2006 Re: [Issue 305] New: version and static if blocks introduce new scope for 'scope' statement | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail Attachments: | d-bugmail@puremagic.com schrieb am 2006-08-23: > http://d.puremagic.com/issues/show_bug.cgi?id=305 > According to the documentation for version blocks, "no new scope is introduced, even if the DeclarationBlock or Statement is enclosed by { }." And the docs for static if say "it does not introduce a new scope even if { } are used for conditionally compiled statements." However, this code: > > void main() > { > version( all ) > { > scope( exit ) printf( "version exit\n" ); > } > static if( true ) > { > scope( exit ) printf( "if exit\n" ); > } > printf( "main\n" ); > } > > Produces this output: > > version exit > if exit > main > > When I expect: > > main > if exit > version exit Added to DStress as http://dstress.kuehne.cn/run/v/version_38_A.d http://dstress.kuehne.cn/run/v/version_38_B.d http://dstress.kuehne.cn/run/v/version_38_C.d http://dstress.kuehne.cn/run/v/version_38_D.d http://dstress.kuehne.cn/run/v/version_38_E.d http://dstress.kuehne.cn/run/s/static_if_07_A.d http://dstress.kuehne.cn/run/s/static_if_07_B.d http://dstress.kuehne.cn/run/s/static_if_07_C.d http://dstress.kuehne.cn/run/s/static_if_07_D.d http://dstress.kuehne.cn/run/s/static_if_07_E.d Thomas |
January 01, 2007 [Issue 305] version and static if blocks introduce new scope for 'scope' statement | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=305 thomas-dloop@kuehne.cn changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED -- |
Copyright © 1999-2021 by the D Language Foundation