[Issue 246] New: class members not initialized

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jul 8 19:20:09 PDT 2006


http://d.puremagic.com/issues/show_bug.cgi?id=246

           Summary: class members not initialized
           Product: D
           Version: 0.162
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: ashleymedlock at yahoo.com


Class members are apparently not initialized in DMD 0.162

// code sample
import std.stdio;

class Foo
{
  float[4]  array = 1.0;            
  int count = 10;
}

void main( char[][] args )
{
  Foo f = new Foo();
  writefln("Foo count = %s", f.count );
}

// this prints 0(zero) on my machine


-- 




More information about the Digitalmars-d-bugs mailing list