Open swift-ci opened 8 years ago
cc granataenrico (JIRA User) to start
Comment by Jin Wang (JIRA)
Any updates on this one?
Comment by Ilya Puchka (JIRA)
Is there any progress with that? With Xcode 8 it is still crashing but now prints "fatal error: attempt to bridge an implicitly unwrapped optional containing nil"
Can it be that the problem is that Mirror.Child is now defined as (String, Any) instead of (String, Any?). If it is Any with nil value how do I unwrap it to check if there is value or not?
Here is the example of code from my project that causes the crash:
public protocol AutoInjectedPropertyBox: class {...}
private func resolveChild(child: Mirror.Child) throws {
guard let injectedPropertyBox = child.value as? AutoInjectedPropertyBox else { return } <- crashes here on a property of mirrored instance which is nil and it's type is IUO
...
}
Environment
Xcode 8 beta 4, swift 3Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler, Standard Library | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 69cb7c66adbb24f9d508a7d33fd983eaIssue Description:
Following code example fails when trying to cast child.value:
But following code examples do not fail:
Also is it intentional that Mirror.Child is now (String?, Any) and not (String?, Any?)