Commit Graph

18 Commits

Author SHA1 Message Date
Max Moiseev
cf4bafe9e3 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-03 13:22:03 -08:00
Kevin Ballard
88a45b6bd0 [Sema][SR-681] Allow catch blocks to rethrow errors when safe
A catch block can only be entered if the do block threw an error. In a
rethrows function, if the do block throws an error only under rethrows
conditions, then the catch block can only be entered under rethrows
conditions, which means the catch block can unconditionally throw and
it's still safe.

This enables code that looks like

```swift
func foo(f: () throws -> Void) rethrows {
    do {
        try f()
    } catch is SomeError {
        throw OtherError()
    }
}
```
2016-02-26 23:19:13 -08:00
Max Moiseev
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
Chris Willmore
983a674e0c Make use of curried function declaration syntax an error.
<rdar://problem/23111018>
2016-01-20 21:57:38 -08:00
Doug Gregor
7d70b704e4 Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines 2016-01-19 23:18:20 -08:00
Chris Lattner
a8deb14ce0 add comment with radar title 2016-01-16 23:18:06 -08:00
Chris Lattner
20263bf466 fix <rdar://problem/24221830> Bogus "no calls to throwing functions" warning in derived throwing init
This is a case where we used to produce:

<unknown>:0: warning: no calls to throwing functions occur within 'try' expression

Which is bogus, due to the try expr implicitly generated as part of the
implicit super.init call for an init that doesn't otherwise contain a super.init.
Silence this warning by ignoring implicitly generated trys, since this try gets
produced before name binding has resolved exactly which try is being invoked.
2016-01-16 23:15:47 -08:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00
ken0nek
3ac60b13f5 Add spaces before and after closure arrow in test 2015-12-23 04:38:46 +09:00
Dmitri Gribenko
feacbc4433 Rename ErrorType to ErrorProtocol 2015-12-09 17:12:19 -08:00
Chris Willmore
30af42fda9 Add warning that curried function decl syntax is going away.
<rdar://problem/23111018>
2015-11-02 15:45:11 -08:00
Jordan Rose
4c82fe3394 Tweak diagnostic text for 'rethrows'-related mistakes.
The first two are now more in line with the messages you get for
non-'rethrows' functions.

rdar://problem/21654534

Swift SVN r30558
2015-07-24 02:45:11 +00:00
Joe Pamer
2d86296827 When converting a closure's function type to a non-escaping function type, only propagate the 'throws' ExtInfo bit if necessary. (rdar://problem/21881995)
Swift SVN r30556
2015-07-23 23:35:42 +00:00
John McCall
7a5ffeddf4 Implement 'rethrows' checking in Sema.
Now with amazing new fixes and tests for methods and generics!

Swift SVN r28499
2015-05-13 00:03:09 +00:00
Ted Kremenek
07251be929 Revert "Implement 'rethrows' checking in Sema."
This was asserting in the performance suite.

Swift SVN r28491
2015-05-12 22:37:20 +00:00
John McCall
3e4bcab7fb Implement 'rethrows' checking in Sema.
Swift SVN r28488
2015-05-12 22:10:41 +00:00
John McCall
fdcecfcfb7 Move error-handling diagnostics to Sema and check try coverage.
Needs better test-case coverage.

Swift SVN r27898
2015-04-29 00:49:40 +00:00
John McCall
3d3f1a7d7e Parsing/AST/Sema support for rethrows, and fix bugs with
throws/rethrows override and conformance checking.

Swift SVN r27508
2015-04-20 23:39:12 +00:00