Bug 20616 – Error: undefined identifier __dollar

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-02-26T21:20:27Z
Last change time
2021-12-13T10:53:01Z
Keywords
bootcamp, diagnostic, trivial
Assigned to
Dorian Verna
Creator
elpenguino+D

Comments

Comment #0 by elpenguino+D — 2020-02-26T21:20:27Z
``` void f() { struct X { auto opSlice(size_t a, size_t b) { return ""; } } auto x = X()[0 .. $]; } ``` The error is technically correct, but not exactly helpful. __dollar is an implementation detail that should not be exposed to the user. I would expect something more along the lines of "Error: no $ operator overload for type X".
Comment #1 by dlang-bot — 2021-10-05T15:23:45Z
@dorianverna17 created dlang/dmd pull request #13130 "Issue 20616" mentioning this issue: - Issue 20616 Modified error message for this issue https://github.com/dlang/dmd/pull/13130
Comment #2 by dlang-bot — 2021-12-13T10:53:01Z
dlang/dmd pull request #13130 "Fix Issue 20616 - Error: undefined identifier __dollar" was merged into master: - 8ea2a3d4e2598fb3b3644be3f0221e443c868732 by dorianverna17: Fix Issue 20616 Issue-20616: Modified commit PR for this issue, added supplemental error call to solve issue Issue-20616: modified PR according to the review Issue-20616: made small changes in the PR according to the review Modified PR according to the review modified PR according to the review Issue-20616: modified output message in expressionsem.d and fail compilation test and condition in opover.d https://github.com/dlang/dmd/pull/13130