[swift-evolution] [Discussion] "try" for function that does not throw

John McCall rjmccall at apple.com
Thu Jul 7 17:28:17 CDT 2016


> On Jul 7, 2016, at 3:26 PM, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
>> On Jul 7, 2016, at 10:58 AM, Vladimir.S via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> I didn't expect this is allowed(with warning):
>> 
>> try print("foo")
>> 
>> (Swift Ver. 3.0 (Jun 20, 2016))
>> 
>> Do we really need to allow 'try' for functions that does not throw exceptions?
> 
> This seems like totally fair game for a “warning: ‘try’ specified for expression that does not throw” with a fixit to remove it.  Please file an enhancement request in bugs.swift.org, this isn’t something appropriate for an evolution proposal.

Agreed.

John.

> 
> -Chris
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list