Summary: template struct opEquals problem
           Product: D
           Version: future
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-06-06 12:30:50 PDT ---
The syntax of this D2 code seems correct (removing the const this code used to
work in D1):

struct Foo(size_t N) {
    bool opEquals(ref const(Foo!(N))) const {
        return false;
alias Foo!(2) Foo2;
void main() {}

But DMD v2.046 prints at compile-time:

test.d(2): Error: function test.Foo!(2).Foo.opEquals type signature should be
const bool(ref const(Foo!(2))) not const bool(ref const(Foo!(N)))
test.d(6): Error: template instance test.Foo!(2) error instantiating

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to