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
Initializing a URL from a unix file path in Swift 6 on Linux now returns a non-nil value (an empty String). In earlier Swift versions and on macOS it returns nil.
On Linux Swift 5.10:
1> import Foundation
2> let u = Foundation.URL(string: "unix:///tmp/file")
[snip]
3> print(u!.host)
nil
On Linux Swift 6.0.1:
1> import Foundation
2> let u = Foundation.URL(string: "unix:///tmp/file")
[snip]
3> print(u!.host)
Optional("")
The text was updated successfully, but these errors were encountered:
If a URL starts with // or contains // after a scheme, this implies that authority exists, which implies that host exists (but may be empty). This helps distinguish a URL with an authority and an empty host, from one where the host does not exist (such as in the URL string relative/path, where .host is nil). I see this was worked-around in AHC, but I'll keep an eye out for any more bincompat reports.
Initializing a URL from a unix file path in Swift 6 on Linux now returns a non-nil value (an empty
String
). In earlier Swift versions and on macOS it returnsnil
.On Linux Swift 5.10:
On Linux Swift 6.0.1:
The text was updated successfully, but these errors were encountered: