[Bug 33] New: No short-circuit evaluation for compile-time expressions?
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Mar 10 11:46:12 PST 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=33
Summary: No short-circuit evaluation for compile-time
expressions?
Product: D
Version: 0.149
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: sean at f4.ca
I think this is arguably not a bug in the same way that compile-time "?:"
expressions evaluate both their arguments regardless of which is selected, but
it's definately non-intuitive:
C:\code\d\bugs>type 149_2.d
import std.c.stdio;
void main()
{
static if( int.mangleof.length > 1 && int.mangleof[1] == 'x' )
printf( "'x' as second char\n" );
}
C:\code\d\bugs>dmd 149_2.d
149_2.d(5): array index [1] is outside array bounds [0 .. 1]
C:\code\d\bugs>
--
More information about the Digitalmars-d-bugs
mailing list