shared class constructor

Jeremie Pelletier jeremiep at gmail.com
Thu Aug 13 09:34:50 PDT 2009


Just came across this while porting my code to enforce the use of shared.

---
module test;
shared class Foo {
   this() {}
}
---
Error: cannot implicitly convert expression (this) of type shared(Foo) to test.Foo

Of course I could just use new shared(Foo) but that would allow non-shared instances of Foo to be created as well, which I do not want.

Shouldn't "this" resolve to the fully qualified class?



More information about the Digitalmars-d mailing list