Initialization error in classes

David Medlock noone at nowhere.com
Fri Jul 7 21:28:49 PDT 2006


David Medlock wrote:
> import std.stdio;
> 
> class Foo
> {
>   float[4]  array = 1.0;            // current color
>   int count = 10;
> }
> 
> void main( char[][] args )
> {
>   Foo f = new Foo();
>   writefln("Foo count = %s", f.count );
> }
> 
> 
> this prints 0(zero) on my machine:
> AMD Athlon 64 3200, 1 GB Ram, DMD 0.162
> 
> This bug was SUCH a PITA, in my program count was set to 1970169165.

Just confirmed this bug does NOT happen in 0.161

-DavidM




More information about the Digitalmars-d-bugs mailing list