<div dir="ltr"><div>2013/5/15 Don Clugston <span dir="ltr"><<a href="mailto:dclugston@gmail.com" target="_blank">dclugston@gmail.com</a>></span></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>But I argue it should simply be an error, rather than replacing it with a misfeature.<br></div></div></div></div></blockquote><div><br></div><div style>
I cannot understand why you argue the new behavior is a 'mesfeature'.</div><div style>Const/immutable variable type and specifying variable initializer should not interfere with each other.</div><div style>Under the old behavior, following code never work.</div>
<div style><br></div><div style>struct S {</div><div style> immutable int x = 1;</div><div style> this(int x) { this.x = x; }</div><div style>}</div><div style>void main() {</div><div style> S s1; // default construction</div>
<div style> assert(s1.x == 1);</div><div> S s2 = S(2); // </div><div> assert(s2.x == 2);<br></div><div style>}</div><div style><br></div><div style>I think this is necessary to make non-mutable object field more usable.</div>
<div style><br></div><div style>Kenji Hara</div></div></div></div>