File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,8 @@ ProtocolDecl::getRethrowingRequirements() const {
41
41
ProtocolRethrowsRequirementList ());
42
42
}
43
43
44
- bool
45
- ProtocolDecl::isRethrowingProtocol () const {
46
- return getRethrowingRequirements ().size () > 0 ;
44
+ bool ProtocolDecl::isRethrowingProtocol () const {
45
+ return getAttrs ().hasAttribute <swift::AtRethrowsAttr>();
47
46
}
48
47
49
48
FunctionRethrowingKind AbstractFunctionDecl::getRethrowingKind () const {
Original file line number Diff line number Diff line change @@ -113,4 +113,12 @@ func rethrowsWithThrowsClosure<T : ThrowsClosure>(_ t: T) rethrows {
113
113
try t. doIt ( ) { }
114
114
}
115
115
116
- try rethrowsWithThrowsClosure ( ThrowsClosureWitness ( ) )
116
+ try rethrowsWithThrowsClosure ( ThrowsClosureWitness ( ) )
117
+
118
+ // Empty protocol
119
+ @rethrows protocol Empty { }
120
+ struct EmptyWitness : Empty { }
121
+
122
+ func takesEmpty< T : Empty > ( _: T ) rethrows { }
123
+
124
+ takesEmpty ( EmptyWitness ( ) )
You can’t perform that action at this time.
0 commit comments