A property of a class of type Dictionary<A,B[]> where B is a non-objc struct, causes a runtime crash
| Originator: | wvvwwvw | ||
| Number: | rdar://17159939 | Date Originated: | 04-Jun-2014 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | |
| Classification: | Bug | Reproducible: | Always |
Summary:
Making a dictionary with a value type which is an array of non-objc type, for instance a struct, then you get a bad instruction error during: Foundation._convertDictionaryToNSDictionary
The following dictionary types work:
Dictionary<String, UInt>
Dictionary<String, UInt[]>
Dictionary<String, User>
But this one does not:
Dictionary<String, User[]>
Steps to Reproduce:
struct User {
let id: UInt
}
class Thing: NSObject {
var dict: Dictionary<String, User[]>
init() {
dict = Dictionary<String, User[]>()
super.init()
}
func doSomething() {
println(dict["blah"])
}
}
Expected Results:
Should print nil
Actual Results:
EXC_BAD_INSTRUCTION within Foundation._convertDictionaryToNSDictionary
Version:
iOS 8
Notes:
Configuration:
Simulator, Version 6.0 (6A215l)
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!