Swift: Cannot work with unwrapped optional array
| Originator: | josh.hinman | ||
| Number: | rdar://17544941 | Date Originated: | 02-Jul-2014 05:45 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6.0 (6a216f) |
| Classification: | Reproducible: |
Summary:
When declaring a variable of an optional array type, I can't call methods like "append" on the array
Steps to Reproduce:
Enter this code into a playground:
var a: String[]?
a = [ "Hello" ]
a!.append("World")
Expected Results:
"a" should contain [ "Hello", "World" ]
Actual Results:
error: "Could not find member 'append'"
Version:
Xcode 6.0 (6a216f)
Notes:
Configuration:
Attachments:
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!