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
macOS 10.13.4 Xcode 9.3.1 (App Store version) Swift 4.1
md5: 8de604f693ab96b710ff8291d6d964d5
Issue Description:
I'd expect this to return a enumerator over URL, but instead it's an enumerator over Any:
URL
Any
Consider the following Swift:
import Foundation let enumerator = FileManager.default.enumerator(at: URL(fileURLWithPath: NSTemporaryDirectory()), includingPropertiesForKeys: nil)! for url in enumerator { print("\(url.path)") }
This results in the following compiler error:
enumerator.swift:5:14: error: value of type 'Any' has no member 'path' print("\(url.path)") ^~~ ~~~~ enumerator.swift:5:14: note: cast 'Any' to 'AnyObject' or use 'as!' to force downcast to a more specific type to access members print("\(url.path)") ^ ( as AnyObject)
It'd be nice if there were a Swift overlay/shim that could improve this here. The situation today is that you have to have to force cast to `URL`.
The text was updated successfully, but these errors were encountered:
Comment by Karthikkeyan Bala Sundaram (JIRA)
Discussion Link: https://forums.swift.org/t/sr-7715-filemanager-directoryenumerator-from-enumerator-atoptions-enumerates-any-instead-of-url/20051
PR: #1873
Sorry, something went wrong.
We can't break source compatibility, but I'm keeping this issue to see if we can make use of this feedback.
No branches or pull requests
Environment
macOS 10.13.4
Xcode 9.3.1 (App Store version)
Swift 4.1
Additional Detail from JIRA
md5: 8de604f693ab96b710ff8291d6d964d5
Issue Description:
I'd expect this to return a enumerator over
URL
, but instead it's an enumerator overAny
:Consider the following Swift:
This results in the following compiler error:
It'd be nice if there were a Swift overlay/shim that could improve this here. The situation today is that you have to have to force cast to `URL`.
The text was updated successfully, but these errors were encountered: