D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20616 - Error: undefined identifier __dollar
Summary: Error: undefined identifier __dollar
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: Dorian Verna
URL:
Keywords: bootcamp, diagnostic, trivial
Depends on:
Blocks:
 
Reported: 2020-02-26 21:20 UTC by elpenguino+D
Modified: 2021-12-13 10:53 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description elpenguino+D 2020-02-26 21:20:27 UTC
```
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 Dlang Bot 2021-10-05 15:23:45 UTC
@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 Dlang Bot 2021-12-13 10:53:01 UTC
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