http://d.puremagic.com/issues/show_bug.cgi?id=11343
--- Comment #11 from Kenji Hara <[email protected]> 2013-10-30 01:49:54 PDT --- (In reply to comment #10) > Couldn't the compiler to this dirty trick for me? > If he found such multiple init case, he could rewrite the code. So that this > code: > ---- > this(int x, size_t i) { > arr[0] = x; > arr[1] = x + 1; > arr[i] = x + 2; // which index will be initialized in runtime? > } > ---- > > if rewritten to this: > > this(int x, size_t i) { > Unqual!typeof(arr) __arr = null; > > __arr[0] = x; > __arr[1] = x + 1; > __arr[i] = x + 2; > > this.arr = __arr; /// only _one_ assignment > } That would be a bad behavior when the size of arr field is quite big, because it will silently consume stack memory. I can believe someone will hate it. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
