Thanks Ali. That has solved the problem. Actually I tried to use that `shared` as follows before:

public shared void delegate( shared(BasicSocketListener) sender ) eventWhenStarted;

Though it didn't work with that. When it is put "before" the attribute name, it works now. It is just confusing where to put it to.

On Monday, 16 June 2014 at 15:25:51 UTC, Ali Çehreli wrote:

Here is a minimal example that reproduces the issue and the hint that compiles the code:

class SocketListener
{
    public void delegate( shared(SocketListener) sender )
    /* shared */    // <-- UNCOMMENT TO COMPILE
    eventWhenStarted;
}

class C
{
    this()
    {
        auto listener = new shared SocketListener();
        listener.eventWhenStarted = &listener_whenStarted;
    }

public void listener_whenStarted( shared(SocketListener) sender ) shared
    {}
}

void main()
{}

Error: cannot implicitly convert expression (&this.listener_whenStarted) of type void delegate(shared(SocketListener) sender) shared to shared(void delegate(shared(SocketListener)))

Ali

Reply via email to