No subject


Sat May 2 20:29:37 PDT 2009


The code

---
struct Struct {
   Struct method() {
      return *this;
   }
}

template Template() {
   const CONST_STRUCT = Struct().method(); // A: no error
} 
alias Template!() foo;

const CONST_STRUCT2 = Struct().method(); // B: error
---

correctly produces an error for line B "non-constant expression
(Struct()).method()" (the CTFE spec says: "4. the function may not be a
non-static member, i.e. it may not have a this pointer"), but doesn't for line
A.

Please either make both lines work and update the spec, or make A an error.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list