September 12, 2012 Possible Bug? | ||||
|---|---|---|---|---|
| ||||
I have this code, which worked fine in dmd 2.058: private GC gc; private alias gc.malloc bson_malloc_func; private alias gc.realloc bson_realloc_func; private alias gc.free bson_free_func; With dmd 2.060 I get this error when I compile: Db/Bson.d(96): Error: variable Db.Bson.gc initializer required for type GC Am I doing something wrong? Shripad K | ||||
September 13, 2012 Re: Possible Bug? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Shripad K | On 12-09-2012 22:59, Shripad K wrote: > I have this code, which worked fine in dmd 2.058: > > private GC gc; > > private alias gc.malloc bson_malloc_func; > private alias gc.realloc bson_realloc_func; > private alias gc.free bson_free_func; > > With dmd 2.060 I get this error when I compile: > Db/Bson.d(96): Error: variable Db.Bson.gc initializer required for type GC > > Am I doing something wrong? > > Shripad K This is happening because the GC type in core.memory now has @disable this(); in it, which disables its default constructor. You're not supposed to instantiate it; it is effectively a static struct. -- Alex Rønne Petersen alex@lycus.org http://lycus.org | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply