[swift-evolution] guard let x = x

William Sumner prestonsumner at me.com
Mon Oct 31 14:22:28 CDT 2016


> On Oct 31, 2016, at 1:11 PM, Kenny Leung via swift-evolution <swift-evolution at swift.org> wrote:
> 
> OK then, how about an extension to the proposal that says “guard variable always implies guard unwrap variable when the only thing present in the guard clause is an optional or list of optionals”?
> 
> So you could write
> 
> guard foo else {
> }
> 
> guard foo, bar else {
> }
> 
> -Kenny


That would enable some strange-looking code:

var foo: Bool?
guard foo, foo else {}

Preston


More information about the swift-evolution mailing list