``` 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".
@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
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