File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
test/refactoring/ConvertAsync Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -4906,7 +4906,7 @@ class AsyncConverter : private SourceEntityWalker {
4906
4906
RightStartLoc = Lexer::getLocForEndOfToken (SM, FD->getThrowsLoc ());
4907
4907
}
4908
4908
SourceLoc RightEndLoc =
4909
- FD->getBody () ? FD->getBody ()->getLBraceLoc () : FD-> getEndLoc () ;
4909
+ FD->getBody () ? FD->getBody ()->getLBraceLoc () : RightStartLoc ;
4910
4910
addRange (RightStartLoc, RightEndLoc);
4911
4911
return ;
4912
4912
}
Original file line number Diff line number Diff line change @@ -150,9 +150,15 @@ struct MyStruct {
150
150
func retStruct( ) -> MyStruct { return MyStruct ( ) }
151
151
152
152
protocol MyProtocol {
153
- // RUN: %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):3 | %FileCheck -check-prefix=PROTO-MEMBER %s
153
+ // RUN: %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+2):3 | %FileCheck -check-prefix=PROTO-MEMBER %s
154
+ // RUN: %refactor -convert-to-async -dump-text -source-filename %s -pos=%(line+1):3 | %FileCheck -check-prefix=PROTO-MEMBER-TO-ASYNC %s
154
155
func protoMember( completion: ( String ) -> Void )
155
156
// PROTO-MEMBER: func protoMember() async -> String{{$}}
157
+
158
+ // FIXME: The current async refactoring only refactors the client side and thus only adds the 'async' keyword.
159
+ // We should be refactoring the entire method signature here and removing the completion parameter.
160
+ // This test currently checks that we are not crashing.
161
+ // PROTO-MEMBER-TO-ASYNC: func protoMember(completion: (String) -> Void) async
156
162
}
157
163
158
164
// RUN: not %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1
You can’t perform that action at this time.
0 commit comments