shared and cryptic error messages

Jason House jason.james.house at gmail.com
Wed Mar 30 16:31:16 PDT 2011


KennyTM~ Wrote:

> On Mar 31, 11 06:34, Jason House wrote:
> > he compiler wants "argument types () shared" instead of "argument types ()". It's an awful error message, and I'm certain I filed a bug for it at least a year ago. In the toy example, mark the destructor as shared, and it should compile.
> 
> Yes you have. http://d.puremagic.com/issues/show_bug.cgi?id=3642
> 
> Your solution works only if OP wills to dig into Phobos and add a shared 
> destructor to File.

I made no claims about how to fix OP's problems. I'm not sure if FILE is even threadsafe to begin with. If we knew Phobos was updated to respect shared, it'd be an indicator of misuse. Even blindly marking the destructor as shared, OP may have to cast away shared in order to use the struct... Here be dragons :)


More information about the Digitalmars-d mailing list