With the attached code it is possible to produce the error mentioned in the subject. Bug #9209 has a similar error message, but quite different code.

DMD32 2.061 on windows.

I don't know, if everybody should go ahead and create tickets in the tracker, so I didn't. Please feel free to create it, if it doesn't overlap with another.

Here you go:

import std.string;

struct Foo {
        this(string bar) {      }
        
        Foo opSlice(size_t start, size_t end) const {
                return Foo();
        }
        
        size_t opDollar(int dim)() const if(dim == 0) { return 1; }
}

int main(string[] ) {
        auto b = Foo("bar")[0..$];
        return 0;
}

Reply via email to