Cannot compare shared Objects

Jacob Carlborg doob at me.com
Sun Sep 12 12:17:26 PDT 2010


The following example doesn't compile with D2:

class Foo
{
     private Object value;

     synchronized bool hasValue (Object val)
     {
         return value == val;
     }
}

It gives the error:

main.d(11): Error: function object.opEquals (Object lhs, Object rhs) is 
not callable using argument types (shared(Object),Object)
main.d(11): Error: cannot implicitly convert expression (this.value) of 
type shared(Object) to object.Object

Is that because object.opEquals hasn't been overloaded with a shared 
version yet? If that's the case has this already been reported in bugzilla?

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list