We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
md5: 8b5c4469cb4daaed76121aa11c7877e9
duplicates:
Issue Description:
$touch somefile $swift Welcome to Swift version 3.0-dev (LLVM 752e1430fc, Clang 1e6cba3ce3, Swift 56052cfe61). Type :help for assistance. 1> import Foundation 2> NSFileManager.defaultManager().fileExists(atPath: "somefile") $R0: Bool = true 3> try! NSFileManager.defaultManager().moveItem(atPath: "somefile", toPath: "otherfile") Execution interrupted. Enter code to recover and continue. Enter LLDB commands to investigate (type :help for assistance.) 4> :bt * thread #​1: tid = 26598, 0x00007ffff7b22592 libswiftCore.so`swift::TargetExistentialTypeMetadata<swift::InProcess>::projectValue(swift::OpaqueValue const*) const + 34, name = 'repl_swift', stop reason = signal SIGSEGV: invalid address (fault address: 0x90) * frame #​0: 0x00007ffff7b22592 libswiftCore.so`swift::TargetExistentialTypeMetadata<swift::InProcess>::projectValue(swift::OpaqueValue const*) const + 34 frame #​1: 0x00007ffff7ae91ec libswiftCore.so`findDynamicValueAndType(swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*, swift::OpaqueValue*&, swift::TargetMetadata<swift::InProcess> const*&, bool&) + 44 frame #​2: 0x00007ffff7ae9edc libswiftCore.so`_dynamicCastToExistential(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetExistentialTypeMetadata<swift::InProcess> const*, swift::DynamicCastFlags) + 60 frame #​3: 0x00007ffff7ae9903 libswiftCore.so`swift_dynamicCast + 659 frame #​4: 0x00007ffff79aa80b libswiftCore.so`generic specialization <preserving fragile attribute, Swift.ErrorProtocol, Swift.String with Swift.String : Swift.OutputStream in Swift> of Swift._debugPrint_unlocked <A, B where B: Swift.OutputStream> (A, inout B) -> () + 155 frame #​5: 0x00007ffff7946b45 libswiftCore.so`swift_unexpectedError + 261 frame #​6: 0x00007ffff7fed12e $__lldb_expr6`main + 302 frame #​7: 0x00000000004009a0 repl_swift`__gmon_start__ + 16 5> import Glibc 6> rename("somefile", "otherfile") $R1: Int32 = 0
Using the latest snapshot (april 25th).
The text was updated successfully, but these errors were encountered:
/cc @parkera @phausler
Sorry, something went wrong.
Huh, it's implemented the same way as your `rename`.
guard self.fileExists(atPath: dstPath) else { throw... }
The destination should not exist; so the negative should be the case:
guard !self.fileExists(atPath: dstPath) else { throw... }
I'll submit a PR for this.
However, apparently printing the error segfaults, I don't think it is supposed to do that?
do { throw NSError(domain: NSCocoaErrorDomain, code: NSCocoaError.FileWriteFileExistsError.rawValue, userInfo: [NSFilePathErrorKey : "abc" as NSString]) } catch let error { print(error) }
Is there a bug in NSError's string conversion function maybe?
Just had a similar problem with NSError being thrown by JSONSerialization. This is very likely the same issue as SR-585.
NSError
JSONSerialization
No branches or pull requests
Additional Detail from JIRA
md5: 8b5c4469cb4daaed76121aa11c7877e9
duplicates:
Issue Description:
Using the latest snapshot (april 25th).
The text was updated successfully, but these errors were encountered: