[Issue 20616] New: Error: undefined identifier __dollar

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 26 21:20:27 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20616

          Issue ID: 20616
           Summary: Error: undefined identifier __dollar
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: elpenguino+D at gmail.com

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

--


More information about the Digitalmars-d-bugs mailing list