www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Another shared bug?

I did some experiments using shared and I came across this problem:

---------------------------------------------------------------------
struct Test
{
    void test() {}
    
    shared void test2()
    {
        (cast(Test)this).test();
    }
    
    void opCall() {}
}

void main()
{
    shared Test t;
    t.test2();
}
---------------------------------------------------------------------
DMD output:
test3.d(7): Error: function test3.Test.opCall () is not callable using 
argument types (shared(Test)) shared
test3.d(7): Error: expected 0 arguments, not 1 for non-variadic function 
type void()
test3.d(7): Error: no property 'test' for type 'void'

Why does dmd think I want to call the opCall in line 7? Is this yet another 
bug introduced by the old property behavior?

-- 
Johannes Pfau
Nov 02 2010