[swift-evolution] In-line scope designators

Haravikk swift-evolution at haravikk.me
Mon Jun 19 17:45:14 CDT 2017

> On 19 Jun 2017, at 21:40, David Sweeris via swift-evolution <swift-evolution at swift.org> wrote:
>> On Jun 19, 2017, at 11:45, Robert Bennett via swift-evolution <swift-evolution at swift.org> wrote:
>> +1 for member variables, -1 for member functions. Functions take up too much vertical space to make this convenient; 
> Yeah, I think that really only made sense in the world of header files, where function declarations were only one line each.
> Off the top of my head, I wouldn't oppose it for non-computed properties, though.

Wouldn't a load of restrictions make it more complex to implement? I would say that if the feature was to be implemented it should just work for everything; this makes it a lot simpler to implement and just leaves it up to developers to decide where it is most appropriate to use it.

After all, very simple computed properties, lazy values and other functions can be written on a single line if you really want to do it, so it seems like this feature would be just as useful for those as well.

I'd probably keep them limited to type declarations though; i.e- not in extensions, since they can already declare visibility (except extensions for conformance, which imply a visibility).

More information about the swift-evolution mailing list