Invalid placement of auto-inserted left square bracket when no braces
| Originator: | greg | ||
| Number: | rdar://13595116 | Date Originated: | 04/07/2013 |
| Status: | Duplicate/11780112 | Resolved: | |
| Product: | Developer Tools | Product Version: | Version 4.6.1 (4H512) |
| Classification: | UI/Usability | Reproducible: | Always |
Summary:
Left square brackets, when auto-completed within a one-line statement without curly braces, where the matching right square bracket is the outer-most statement, are always placed on the line above where they should be.
Steps to Reproduce:
1. Type the following into an Xcode Objective-C document:
NSMutableArray *array = [[NSMutableArray alloc] init];
for (int i = 0; i < 10; i++)
array addObject:@""
2. With the insertion point to the right of the second " character on line 3 from above, press the right square bracket key on the keyboard.
Expected Results:
Right square bracket inserted after second '"' on line 3 and left square bracket inserted before first 'a' on line 3:
NSMutableArray *array = [[NSMutableArray alloc] init];
for (int i = 0; i < 10; i++)
[array addObject:@""]
Actual Results:
Right square bracket inserted after second '"' on line 3 and left square bracket inserted before first '(' on line 2, resulting in syntax error:
NSMutableArray *array = [[NSMutableArray alloc] init];
for [(int i = 0; i < 10; i++)
array addObject:@""]
Regression:
Been like this for a while.
Notes:
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!