Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-7949] Crash when bridging NSError to CLError #3678

Open
sharplet opened this issue Jun 9, 2018 · 0 comments
Open

[SR-7949] Crash when bridging NSError to CLError #3678

sharplet opened this issue Jun 9, 2018 · 0 comments

Comments

@sharplet
Copy link

sharplet commented Jun 9, 2018

Previous ID SR-7949
Radar rdar://problem/40878715
Original Reporter @sharplet
Type Bug
Environment

Xcode 10 beta 1

Additional Detail from JIRA
Votes 0
Component/s Compiler, Foundation
Labels Bug, 4.2Regression
Assignee None
Priority Medium

md5: d3a7d254efdede1a220eb1527c0e9772

Issue Description:

Under Xcode 9 / Swift 4.1, it was possible to construct an NSError with the appropriate domain and code and have it bridge to a CLError using an as? cast in Swift. This causes a crash in Xcode 10 / Swift 4.2.

To reproduce, run the attached playground in Xcode 10. It contains this code:

import CoreLocation

let error = NSError(
  domain: kCLErrorDomain,
  code: CLError.geocodeFoundNoResult.rawValue)

error.localizedDescription
error is CLError
error as? CLError
@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant