let dest = "/tmp/a/b/c"
let fm = FileManager.default
try fm.createDirectory(atPath: dest, withIntermediateDirectories: true, attributes: nil)
let _ = fm.changeCurrentDirectoryPath(dest)
let _ = fm.currentDirectoryPath // it's ok
try fm.removeItem(atPath: dest)
let _ = fm.currentDirectoryPath // will crash
The same code in the old version(<5.10) of swift will be empty string.
Forced unpacking caused a crash.
The same code in the old version(<5.10) of swift will be empty string.