www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20616] New: Error: undefined identifier __dollar

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 puremagic.com
          Reporter: elpenguino+D 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".

--
Feb 26