Skip to content

Swift 3 support #13

@sauliusgrigaitis

Description

@sauliusgrigaitis

Swift 3 introduced breaking changes:

 Compiling Swift Module 'PathKit061' (1 sources)
/home/saulius/workspace/Swifton/Packages/PathKit-0.6.1/Sources/PathKit.swift:38:19: error: 'CollectionType' has been renamed to 'Collection'
  public init<S : CollectionType where S.Generator.Element == String>(components: S) {
                  ^~~~~~~~~~~~~~
                  Collection
/home/saulius/workspace/Swifton/Packages/PathKit-0.6.1/Sources/PathKit.swift:38:42: error: 'Generator' is not a member type of 'S'
  public init<S : CollectionType where S.Generator.Element == String>(components: S) {
                                       ~ ^
/home/saulius/workspace/Swifton/Packages/PathKit-0.6.1/Sources/PathKit.swift:577:18: error: 'SequenceType' has been renamed to 'Sequence'
extension Path : SequenceType {
                 ^~~~~~~~~~~~
                 Sequence
/home/saulius/workspace/Swifton/Packages/PathKit-0.6.1/Sources/PathKit.swift:580:39: error: 'GeneratorType' has been renamed to 'IteratorProtocol'
  public struct DirectoryEnumerator : GeneratorType {
                                      ^~~~~~~~~~~~~
                                      IteratorProtocol
/home/saulius/workspace/Swifton/Packages/PathKit-0.6.1/Sources/PathKit.swift:39:8: error: value of type 'S' has no member 'isEmpty'
    if components.isEmpty {
       ^~~~~~~~~~ ~~~~~~~
/home/saulius/workspace/Swifton/Packages/PathKit-0.6.1/Sources/PathKit.swift:41:15: error: value of type 'S' has no member 'first'
    } else if components.first == Path.separator && components.count > 1 {
              ^~~~~~~~~~ ~~~~~
/home/saulius/workspace/Swifton/Packages/PathKit-0.6.1/Sources/PathKit.swift:42:15: error: value of type 'S' has no member 'joinWithSeparator'
      let p = components.joinWithSeparator(Path.separator)
              ^~~~~~~~~~ ~~~~~~~~~~~~~~~~~
/home/saulius/workspace/Swifton/Packages/PathKit-0.6.1/Sources/PathKit.swift:51:14: error: value of type 'S' has no member 'joinWithSeparator'
      path = components.joinWithSeparator(Path.separator)
             ^~~~~~~~~~ ~~~~~~~~~~~~~~~~~
/home/saulius/workspace/Swifton/Packages/PathKit-0.6.1/Sources/PathKit.swift:557:30: error: 'fromCString' is unavailable: Please use String.init?(validatingUTF8:) instead. Note that it no longer accepts NULL as a valid input. Also consider using String(cString:), that will attempt to repair ill-formed code units.
        if let path = String.fromCString(gt.gl_pathv[index]) {
                             ^~~~~~~~~~~
Swift.String:4:24: note: 'fromCString' has been explicitly marked unavailable here
    public static func fromCString(cs: UnsafePointer<CChar>) -> String?
                       ^
/home/saulius/workspace/Swifton/Packages/PathKit-0.6.1/Sources/PathKit.swift:557:30: error: 'fromCString' is unavailable: Please use String.init?(validatingUTF8:) instead. Note that it no longer accepts NULL as a valid input. Also consider using String(cString:), that will attempt to repair ill-formed code units.
        if let path = String.fromCString(gt.gl_pathv[index]) {
                             ^~~~~~~~~~~
Swift.String:4:24: note: 'fromCString' has been explicitly marked unavailable here
    public static func fromCString(cs: UnsafePointer<CChar>) -> String?
                       ^
<unknown>:0: error: build had 1 command failures
error: exit(1): /home/saulius/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2016-03-24-a/usr/bin/swift-build-tool -f /home/saulius/workspace/Swifton/Packages/PathKit-0.6.1/.build/debug.yaml default

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions