digitalmars.D.bugs - [Issue 23203] New: Wrong error message for argument mismatch on
- d-bugmail puremagic.com (33/33) Jun 22 2022 https://issues.dlang.org/show_bug.cgi?id=23203
https://issues.dlang.org/show_bug.cgi?id=23203 Issue ID: 23203 Summary: Wrong error message for argument mismatch on shared objects Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: sludwig outerproduct.org 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)` --
Jun 22 2022