The following produces a very misleading error message, indicating that `shared` is the problem, whereas the actual issue is a simple argument type mismatch. Having only the shared method in the overload set fixes the issue.
---
struct S {
void foo(string s) {}
void foo(string s) shared {}
}
void main()
{
shared(S) s;
s.foo(42);
}
---
onlineapp.d(9): Error: none of the overloads of `foo` are callable using a `shared` object
onlineapp.d(2): Candidates are: `onlineapp.S.foo(string s)`
onlineapp.d(3): `onlineapp.S.foo(string s)`
Comment #1 by robert.schadek — 2024-12-13T19:23:32Z