<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><span></span></div><div><div>I think this was the original intent of SE-0025, but it is subject to the issue I raised in the root: If the entire decl is declaration-private, then it cannot be constructed because its members are also declaration-private. We can forbid it at the top level but that doesn't solve the problem for inner classes and we'd have to needlessly special-case the grammar. We could solve it with a diagnostic for top-level declaration-private aggregates but is that really a good solution? Then again, we could raise the access level of declaration-private members with no access modifier but then we'd break containment and we're back to square one because declaration-private now just effectively means fileprivate for this one huge use case.<br><br>~Robert Widmann</div><div><br>2016/06/15 22:02、Charlie Monroe <<a href="mailto:charlie@charliemonroe.net">charlie@charliemonroe.net</a>> のメッセージ:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div class="">Wouldn't this get solved by ditching fileprivate (which would be /is right now/ the default behavior for private) and introduce a more private level instead, e.g. "declaration" or "scope"</div><div class=""><br class=""></div><div class="">/// File A</div><div class=""><br class=""></div><div class="">public struct MyStruct {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>declaration var x: Int</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>private var y: Int</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>internal var z: Int</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>init() {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>x = 0</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>y = 1</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>z = 2</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div class="">}</div><div class=""><br class=""></div><div class="">/// Within the same file</div><div class="">let str = MyStruct()</div><div class="">str.x // Error</div><div class="">str.y // OK</div><div class="">str.z // OK</div><div class=""><br class=""></div><div class="">/// File B</div><div class=""><br class=""></div><div class=""><div class="">/// Another file</div><div class="">let str = MyStruct()</div><div class="">str.x // Error</div><div class="">str.y // Error</div><div class="">str.z // OK</div></div><div class=""><br class=""></div><div class="">I know that this goes in the other direction than the original proposal, but it would solve all these issues, while fully preserving backward compatibility. Am I missing something?</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 16, 2016, at 6:30 AM, Robert Widmann via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class="">Yes, we agree. Can we please discuss what to do about SE-0025?<br class=""><br class="">~Robert Widmann</div><div class=""><br class="">2016/06/15 21:18、Charles Srstka <<a href="mailto:cocoadev@charlessoft.com" class="">cocoadev@charlessoft.com</a>> のメッセージ:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><blockquote type="cite" class="">On Jun 15, 2016, at 11:04 PM, Charles Srstka via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""></blockquote><div class=""><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Result is that the property is only accessible from inside its parent type.</span></div></blockquote></div><br class=""><div class="">*inside the type’s parent type</div><div class=""><br class=""></div><div class="">Charles</div><div class=""><br class=""></div></div></blockquote></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></blockquote></div></body></html>