Bug 20024 – "No property x for type Y" error not as helpful as it should be

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-07-03T18:27:13Z
Last change time
2019-08-11T16:06:15Z
Keywords
diagnostic
Assigned to
No Owner
Creator
elpenguino+D

Comments

Comment #0 by elpenguino+D — 2019-07-03T18:27:13Z
``` auto x = ["a","b","c"]; auto y = x.joiner(); ``` Given code like this, the compiler will issue a `Error: No property joiner for type string[]` error. Changing the second line to `joiner(x)` will give a more useful `Error: joiner is not defined, perhaps import std.algorithm; is needed?`. The former error message should be made to be more like the latter. It should address the possibility of UFCS and suggest the same import.
Comment #1 by dlang-bot — 2019-08-10T23:55:21Z
@wilzbach created dlang/dmd pull request #10301 "Issue 20024 - "No property x for type Y" error not as helpful as it should be" mentioning this issue: - Issue 20024 - "No property x for type Y" error not as helpful as it should be https://github.com/dlang/dmd/pull/10301
Comment #2 by dlang-bot — 2019-08-11T16:06:15Z
dlang/dmd pull request #10301 "Issue 20024 - "No property x for type Y" error not as helpful as it should be" was merged into master: - 4d7895cba8933474c4b9c874068d298151de9e0c by Sebastian Wilzbach: Fix Issue 20024 - "No property x for type Y" error not as helpful as it should be https://github.com/dlang/dmd/pull/10301