> FWIW, in almost all the situations where I’ve wanted to nest types inside
> protocols and generic types, it’s only as a namespacing convenience. Most
> often, it’s an enum type that’s used only by a single method, and having it
> at the top of the module namespace adds clutter.
> Alternatively, what if (1) outer types aren’t capture unless they’re
> referenced, and (2) nesting is only illegal if there’s a capture?
I was just about to write something similar, but Paul said it better.
Why don’t we allow everything to be nested in everything for namespacing
purposes (which is most of why I want it), but forbid references to generic or
associated types from the nested type? Then, as the generics manifesto gets
implemented, we can start allowing certain generics to be referenced over time
as they start to become possible and make sense (but we wouldn’t worry about
that yet for this proposal)
Is there another issue which would keep that simpler version from working?
Thanks,
Jon
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution