Take the following code:
void main() //Can be empty, problem occurs regardless
{
}
int test(int a) //Test function.
{
return 3 * a;
}
//Now overload it for shared...
int test(shared int a) shared
{
return cast(shared(int))test(cast(int)a); //Note: The problem still happens regardless whether you have this line or not.
}
Compiling on the latest version, the compiler output you get should be(assuming the file is named test.d):
Error: function 'test.test' without 'this' cannot be 'shared'