Geez, I try to write some multithreaded code and I just keep hitting these:
--------
module test3;

struct SomeData {
int i;
 int iPlus2() {
return i + 2;
 }
}

synchronized class Bob {
private:
SomeData _dat;
 public:
this() {
_dat.i = 3;
 }
 @property
 int i() {
return _dat.iPlus2(); // test3.d(22): Error: function test3.SomeData.iPlus2
() is not callable using argument types () shared
 }
}
--------

This seems like it should be legal because SomeData is a value type.
Accessing _dat.i directly is legal, and _dat can't possibly be shared. If
I'm understanding things correctly, transitive shared shouldn't apply to
value types like this, so the type of "this" when calling iPlus2 should just
be SomeData.

Reply via email to