[swift-evolution] [Discussion] "try" for function that does not throw
Chris Lattner
clattner at apple.com
Thu Jul 7 17:26:11 CDT 2016
> 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.
-Chris
More information about the swift-evolution
mailing list