Bug 23203 – Wrong error message for argument mismatch on shared objects

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-06-22T08:40:45Z
Last change time
2024-12-13T19:23:32Z
Assigned to
No Owner
Creator
Sönke Ludwig
Moved to GitHub: dmd#18112 →

Comments

Comment #0 by sludwig — 2022-06-22T08:40:45Z
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18112 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB