<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jun 29, 2016 at 5:33 PM, Michael Peternell via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> Am 30.06.2016 um 00:17 schrieb Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>>:<br>
><br>
> Here is the problem:<br>
><br>
> ```<br>
> private struct Foo {<br>
> /* private */ struct Bar {<br>
> // it doesn't matter what you write in here, you'll never see it in `Foo`<br>
> }<br>
> }<br>
> ```<br>
><br>
<br>
</span>So this is not a practical design for this feature then. Following the ideas I presented a few hours earlier this should lead to:<br>
<br>
private struct Foo {<br>
struct Bar {<br>
var strawberryBar: [String]<br>
}<br>
// Scope(Bar) = Scope(Foo), because the scope of Bar is unspecified<br>
// Scope(Bar.strawBerryBar) = Scope(Bar) = Scope(Foo), for the same reason<br>
// Foo is visible here => Bar.strawberryBar is visible too<br>
<br>
func hello() {<br>
let s = Bar(strawberryBar: ["yummi"]<br>
print("mjam: \(s.strawberryBar)")<br>
}<br>
// everything compiles...<br>
}<br>
<br>
Making Bar implicitly private doesn't make sense at all. Bar should have the same scope as Foo. `private` on Bar has a completely different meaning than `private` on Foo so this is not the same access level. The implicit access level of Bar is unutterable here.<br>
<br>
Anyways... I'm out. I think there *is* a possible design that works. As long as no one provides another (possibly better) solution or argues with my why my design can not work I see no point (for me) in continuing this discussion.<br></blockquote><div><br></div><div>Yes, I think that would work; but it sounds like the core team has rejected this suggestion, so I'm suggesting others.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
-Michael<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div></div>