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
NSURL(fileURLWithPath: "").lastPathComponent just returns nil.
This seems bugs.swift.org-y to me since it has to do with one of the new value-types, but I don't have easy access to an Ubuntu machine to test it on at the moment. Please let me know if I should refile as a radar instead.
Possibly related to SR-2591 — see the comments below.
The text was updated successfully, but these errors were encountered:
Interesting. I ran into another garbage NSString/String problem with URL at the same time. I didn't think they were the same thing because this consistently returns "testing" for me, whereas that one seems like it's just reading random bytes from the heap. I'll create a new issue for that and link it here.
Oops, never mind — I think this returns the lastPathComponent of the current working directory. URL(fileURLWithPath: "") might be the root cause here. That call produces this: {{ URL = "./ – ile:///Users/field-thompson/dev/testing/" }} . I think that's the wrong way to display the URL and it's a little surprising seeing as it's a change in behavior, but it's correct according to the doc comment, so I'll close this bug.
Environment
OS X El Capitan 10.11.6, Xcode 8 GM, Swift 3.0.
Additional Detail from JIRA
md5: ac45d0d3490a3144fcfec1d7a03f04d4
Issue Description:
I saw this both in the REPL and when compiling a file.
NSURL(fileURLWithPath: "").lastPathComponent
just returnsnil
.This seems bugs.swift.org-y to me since it has to do with one of the new value-types, but I don't have easy access to an Ubuntu machine to test it on at the moment. Please let me know if I should refile as a radar instead.
Possibly related to SR-2591 — see the comments below.
The text was updated successfully, but these errors were encountered: