<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><span class=""><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div style="font-size:14px;font-family:helvetica,arial,freesans,clean,sans-serif;line-height:1.6;padding:30px;background-color:rgb(255,255,255);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin:15px;outline:0px;border:0px"><p style="margin:0px 0px 15px">When do properties with behaviors get included in the memberwise initializer of structs or classes, if ever? Can properties with behaviors be initialized from <code style="margin:0px 2px;padding:0px 5px;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;color:rgb(51,51,51)">init</code> rather than with inline initializers?</p></div></div></div></blockquote><div> There’s a separate discussion that mentioned allowing better control of which initializers are generated or synthesized for a given struct. There’s also been mention of a “derived” feature for adding conformance without needing to supply a separate implementation. This question seems related to me - it would be ideal if Swift had a coherent way to declare something that did not need definition because it can be generated by the compiler. In this case, to declare that a property is part of memberwise initialization. `behavior lazy&lt;T&gt;: memberwise {` ?</div></div></div></div></blockquote><div><br></div></span><div>You might be talking about the initialization discussion I was involved in a week or so ago.  I&#39;m working on a proposal that would allow for more flexible control over synthesized memberwise initialization.  I&#39;m hoping to have a draft ready soon.</div></div></blockquote><div><br></div><div>Great! Looking forward to reading it.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br></div><div>Is your example here part of a behavior declaration for lazy which states that properties with the lazy behavior may be memberwise initialized?  That&#39;s what it looks like to me.  I think syntax like that would make sense.  There are some behaviors which would need to opt out.  Somewhat ironically, I think lazy is one of them as the whole point of it is that it is not initialized immediately, but rather on first access.</div><div><br></div></div></blockquote><div>Yes, that was the idea behind that syntax. Hah, lazy was a terrible example, you’re right. Distracted emailing never ends well.</div><div><br></div><div>It could be either opt-in (as my example hinted). Opt-out might be a bit harder to express, and I’m not sure if opt-in is the right default. </div></div></div></div>