<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">Maybe what you want is </div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default"><div class="gmail_default"><font face="georgia, serif">struct S1 {</font></div><div class="gmail_default"><font face="georgia, serif">    private var _v = 1</font></div><div class="gmail_default"><font face="georgia, serif">    var v:Int {</font></div><div class="gmail_default"><font face="georgia, serif">        get {</font></div><div class="gmail_default"><font face="georgia, serif">            return self._v</font></div><div class="gmail_default"><font face="georgia, serif">        }</font></div><div class="gmail_default"><font face="georgia, serif">    }</font></div><div class="gmail_default"><font face="georgia, serif">}</font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif">Zhaoxin</font></div></div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 19, 2017 at 2:08 AM, Jordan Rose via swift-users <span dir="ltr">&lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt;</span> wrote:<br><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>It is a terrible error message, though. I&#39;ve filed <a href="https://bugs.swift.org/browse/SR-3671" target="_blank">SR-3671</a> to improve it. Thanks, LiMing (and Adrian).</div><div><br></div><div>Jordan</div><div><div class="h5"><div><br></div><br><div><blockquote type="cite"><div>On Jan 18, 2017, at 07:29, Adrian Zubarev via swift-users &lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt; wrote:</div><br class="m_4458767015170382903Apple-interchange-newline"><div><div class="m_4458767015170382903bloop_markdown" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"><p style="margin:15px 0px">Computed properties do not have any default values. That said, you can only use<span class="m_4458767015170382903Apple-converted-space"> </span><code style="font-family:Menlo,Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:10pt;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:rgb(248,248,248);color:inherit;border:1px solid rgb(234,234,234);margin:0px 2px;padding:0px 5px;word-break:normal;word-wrap:normal">didSet</code><span class="m_4458767015170382903Apple-converted-space"> </span>or<span class="m_4458767015170382903Apple-converted-space"> </span><code style="font-family:Menlo,Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:10pt;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:rgb(248,248,248);color:inherit;border:1px solid rgb(234,234,234);margin:0px 2px;padding:0px 5px;word-break:normal;word-wrap:normal">willSet</code><span class="m_4458767015170382903Apple-converted-space"> </span>on properties like yours to observe them or remove the default value from the computed property completely to use<span class="m_4458767015170382903Apple-converted-space"> </span><code style="font-family:Menlo,Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:10pt;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:rgb(248,248,248);color:inherit;border:1px solid rgb(234,234,234);margin:0px 2px;padding:0px 5px;word-break:normal;word-wrap:normal">get</code><span class="m_4458767015170382903Apple-converted-space"> </span>and<span class="m_4458767015170382903Apple-converted-space"> </span><code style="font-family:Menlo,Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:10pt;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:rgb(248,248,248);color:inherit;border:1px solid rgb(234,234,234);margin:0px 2px;padding:0px 5px;word-break:normal;word-wrap:normal">set</code>.</p><div style="margin:15px 0px"><br class="m_4458767015170382903webkit-block-placeholder"></div></div><div class="m_4458767015170382903bloop_original_html" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"><div id="m_4458767015170382903bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px"><br></div><br><div id="m_4458767015170382903bloop_sign_1484753264544080128" class="m_4458767015170382903bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>Adrian Zubarev<br>Sent with Airmail</div></div><br><p class="m_4458767015170382903airmail_on" style="margin:15px 0px">Am 18. Januar 2017 um 15:06:16, Wang LiMing via swift-users (<a href="mailto:swift-users@swift.org" style="color:rgb(65,131,196);background-color:inherit;text-decoration:none" target="_blank">swift-users@swift.org</a>) schrieb:</p><blockquote type="cite" class="m_4458767015170382903clean_bq" style="margin:15px 0px"><span style="margin-top:0px;margin-bottom:0px"><div style="word-wrap:break-word"><div></div><div><div>In latest Xcode(8.2.1), playground</div><div><br></div>struct S1 {<div>  var v = 1 {</div><div>    get {                   // report Error: Use of unresolved identifier ‘get&#39;</div><div>      return self.v.    // report Error: Use of unresolved identifier ‘self&#39;</div><div>   }</div><div>}</div><div><br></div><div>I can’t found the reason about the error.</div><div><div style="margin:0px;font-size:13px;line-height:normal;font-family:&#39;Source Code Pro Light&#39;;color:rgb(117,144,219);min-height:17px"></div></div>______________________________<wbr>_________________<br>swift-users mailing list<br><a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br></div></div></span></blockquote></div><div class="m_4458767015170382903bloop_markdown" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"><div style="margin:15px 0px"><br class="m_4458767015170382903webkit-block-placeholder"></div></div><span style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254);float:none;display:inline!important">______________________________<wbr>_________________</span><br style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"><span style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254);float:none;display:inline!important">swift-users mailing list</span><br style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"><a href="mailto:swift-users@swift.org" style="color:rgb(65,131,196);background-color:rgb(254,254,254);text-decoration:none;font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">swift-users@swift.org</a><br style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"><a href="https://lists.swift.org/mailman/listinfo/swift-users" style="color:rgb(65,131,196);background-color:rgb(254,254,254);text-decoration:none;font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"></div></blockquote></div><br></div></div></div><br>______________________________<wbr>_________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br>
<br></blockquote></div><br></div>