http://d.puremagic.com/issues/show_bug.cgi?id=9051
--- Comment #3 from Don <clugd...@yahoo.com.au> 2012-11-26 00:56:22 PST --- (In reply to comment #2) > (In reply to comment #1) > > The error message is not coming from CTFE. Here's a simple case from a > > comment > > in the compiler source code (declaration.c): > > > > /* The problem is the following code: > > * struct CopyTest { > > * double x; > > * this(double a) { x = a * 10.0;} > > * this(this) { x += 2.0; } > > * } > > * const CopyTest z = CopyTest(5.3); // ok > > * const CopyTest w = z; // not ok, postblit not run > > * static assert(w.x == 55.0); > > * because the postblit doesn't get run on the initialization of w. > > */ > > > > I think that if we didn't call this(this), wrong code would result. > > I agree in general. And But given that getMeASet(uint[] arr) is an r-value. > Surely the result of it should be just moved? > > The other thought is: can't this(this) be run at compile-time then? What are > limitations? Yeah, that's kind of like bug 7988. The calling of this(this) should be part of the CTFE'd bit. CTFE could cope with it, no problem, it just doesn't get a chance. BTW if we moved the this(this) into CTFE, the example I posted would also work! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------