Unmatched static array size assignment

Andrej Mitrovic none at none.none
Wed Apr 13 13:58:26 PDT 2011


Andrej Mitrovic Wrote:

> So in retrospect:
> // no error until a call to writefln,
> // which could still potentially not fail => possible bugs
> string[2] szFormat = ["%s, %s"];            
> 
> // error at runtime, the compiler could have caught this though
> static string[2] szFormat2 = ["%s, %s"];
> 

Sorry, I've accidentally reversed the two. Fixed:
// no error until a call to writefln,
// which could still potentially not fail => possible bugs
static string[2] szFormat = ["%s, %s"];            
 
// error at runtime, the compiler could have caught this though
string[2] szFormat2 = ["%s, %s"];



More information about the Digitalmars-d-learn mailing list