You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swift-ci opened this issue
Mar 29, 2017
· 2 comments
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfruntimeThe Swift Runtime
1. Make a protocol `A`.
2. Conform a protocol into `CustomError` and `NSError`.
3. Cast `Error` to `A`, then implicit type cast `Error` to `NSError` work.
Minimum code is here.
importFoundationprotocolMyCustomErrorProtocol {
varhoge: Int { get }
}
structMyCustomError: Error, MyCustomErrorProtocol {
varhoge: Int {
return1
}
}
extensionNSError: MyCustomErrorProtocol {
varhoge: Int {
return0
}
}
leterror: Error = MyCustomError()
ifletcError = erroras? MyCustomErrorProtocol {
cError.hoge// 0 (If Swift 3.0 then 1)
}
The text was updated successfully, but these errors were encountered:
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfruntimeThe Swift Runtime
Environment
Swift 3.1, Xcode 8.3, Playground
Additional Detail from JIRA
md5: 6da17e3a189bae0abaaf29a0dc66b997
Issue Description:
1. Make a protocol `A`.
2. Conform a protocol into `CustomError` and `NSError`.
3. Cast `Error` to `A`, then implicit type cast `Error` to `NSError` work.
Minimum code is here.
The text was updated successfully, but these errors were encountered: