Re: [swift-evolution] [Pitch] Make try? + optional chain flattening work together

2018-01-12 Thread Matthew Johnson via swift-evolution
> On Jan 12, 2018, at 2:00 PM, John McCall via swift-evolution > wrote: > > >> On Jan 12, 2018, at 12:53 PM, BJ Homer via swift-evolution >> > wrote: >> >> I agree that this behavior is annoying.

Re: [swift-evolution] [Pitch] Make try? + optional chain flattening work together

2018-01-12 Thread John McCall via swift-evolution
> On Jan 12, 2018, at 12:53 PM, BJ Homer via swift-evolution > wrote: > > I agree that this behavior is annoying. However, wouldn’t it be > source-breaking to change this now? Source compatibility means that we can't change the behavior of Swift 3 / Swift 4

Re: [swift-evolution] [Pitch] Make try? + optional chain flattening work together

2018-01-12 Thread Nevin Brackett-Rozinsky via swift-evolution
This is not an optional-chaining issue *per se*. If you simply write, let a = try? SomeType().doThrow() // a has type SomeType?? you get a double-optional as well. Are you proposing to change that? Nevin On Fri, Jan 12, 2018 at 12:25 PM, Russ Bishop via swift-evolution <

Re: [swift-evolution] [Pitch] Make try? + optional chain flattening work together

2018-01-12 Thread BJ Homer via swift-evolution
I agree that this behavior is annoying. However, wouldn’t it be source-breaking to change this now? -BJ > On Jan 12, 2018, at 10:25 AM, Russ Bishop via swift-evolution > wrote: > > Greetings swift-evolution! > > There is currently a disconnect between optional

[swift-evolution] [Pitch] Make try? + optional chain flattening work together

2018-01-12 Thread Russ Bishop via swift-evolution
Greetings swift-evolution! There is currently a disconnect between optional chaining and try? when it comes to optional flattening: struct SomeType { func nonThrow() -> SomeType? { return self } func doThrow() throws -> SomeType? { return self } func nonOptional() throws ->