Xcode 9: Moving Objective-C methods across other methods using Editor > Structure > Move Line Up/Down corrupts the source code
| Originator: | mail.junjie | ||
| Number: | rdar://32830213 | Date Originated: | June 17 2017, 3:22 PM |
| Status: | Resolved: | ||
| Product: | Developer Tools | Product Version: | Version 9.0 beta (9M136h) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary:
Xcode provides a way to move lines of codes around a source file with Editor > Structure > Move Line Up ⌥⌘[ and Move Line Down ⌥⌘]. In Xcode 9, moving an Objective-C method across another method corrupts the source code. For example, attempting to move -testMethodA below -testMethodB in the following code:
- (NSString *)testMethodA
{
return [self uppercaseString];
}
- (NSString *)testMethodB
{
return [self lowercaseString];
}
results in:
- (NSString *)testMethodB
{- (NSString *)testMethodA
{
return [self uppercaseString];
}}
return [self lowercaseString];
}
- (NSString *)testMethodA
{
return [self uppercaseString];
}
Steps to Reproduce:
1. Open the included source code (or use an existing Objective-C .m source code)
2. Attempt to move an entire method below another method using Editor > Structure > Move Line Down ⌥⌘]
Expected Results:
1. The method should move below without corrupting the source code
Observed Results:
1. The method moves below the method while corrupting the source code
Version:
Version 9.0 beta (9M136h)
macOS 10.12.4 (16E195)
Notes:
Configuration
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!