Add feature for rethrows protocols and use it in module interface generation

This commit is contained in:
Doug Gregor
2021-02-22 16:18:47 -08:00
parent 267838db44
commit f21c60928c
3 changed files with 62 additions and 0 deletions

View File

@@ -67,6 +67,16 @@ public class OldSchool: MP {
public func takeClass() async { }
}
// CHECK: #if compiler(>=5.3) && $RethrowsProtocol
// CHECK-NEXT: @rethrows public protocol RP
@rethrows public protocol RP {
func f() throws
}
// CHECK: #if compiler(>=5.3) && $RethrowsProtocol
// CHECK-NEXT: public func acceptsRP
public func acceptsRP<T: RP>(_: T) { }
// CHECK-NOT: #if compiler(>=5.3) && $MarkerProtocol
// CHECK: extension Array : FeatureTest.MP where Element : FeatureTest.MP {
extension Array: FeatureTest.MP where Element : FeatureTest.MP { }