Re: [swift-evolution] Property Getter Return Statement

2017-10-08 Thread Charles Srstka via swift-evolution
> On Oct 7, 2017, at 12:22 PM, Tony Allevato via swift-evolution > wrote: > > I think the important thing to consider is, what advantage would such a > feature provide *other* than to reduce keystrokes? (I don't personally think > that optimizing for keys pressed by itself should be a goal.)

Re: [swift-evolution] Property Getter Return Statement

2017-10-08 Thread Slava Pestov via swift-evolution
> On Oct 7, 2017, at 7:07 AM, James Valaitis via swift-evolution > wrote: > > Is it widely agreed that it is necessary to require a return statement on a > one line property getter? > > var session: AVCaptureSession { get { return layer.session } } > > Or could we follow the convention for

Re: [swift-evolution] Property Getter Return Statement

2017-10-08 Thread David Hart via swift-evolution
> On 7 Oct 2017, at 19:22, Tony Allevato via swift-evolution > wrote: > > I think the important thing to consider is, what advantage would such a > feature provide *other* than to reduce keystrokes? (I don't personally think > that optimizing for keys pressed by itself should be a goal.) > >

Re: [swift-evolution] Pitch: Restrict Cross-module Struct Initializers

2017-10-08 Thread Rudolf Adamkovič via swift-evolution
This is a great proposal. However, it can make unit testing problematic. Let me explain. In my unit tests, I often add initializers that set stored properties directly to create structs with desired data and those are then fed into the struct that’s under test. This is to test in complete isola