Open
Description
Previous ID | SR-5107 |
Radar | rdar://problem/32589382 |
Original Reporter | aaroncrespo (JIRA User) |
Type | Bug |
Environment
Xcode 9M136h
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler, Foundation |
Labels | Bug, Migrator |
Assignee | None |
Priority | Medium |
md5: 9656be8f98655e1c73d7eb1b8b95239e
Issue Description:
The following FileManager usage needs changing between swift 4 and swift 3.
enum AnError: Error {
case creating
}
#if swift(>=4)
var attributes = [FileAttributeKey: Any]()
attributes[FileAttributeKey.modificationDate] = modifiedOverride
guard FileManager.default.createFile(atPath: path.relativePath, contents: nil, attributes: attributes) else { //create
throw AnError.creating
}
#else
var attributes = [String: Any]()
attributes[FileAttributeKey.modificationDate.rawValue] = modifiedOverride
guard FileManager.default.createFile(atPath: path.relativePath, contents: nil, attributes: attributes) else { //create
throw AnError.creating
}
#endif