Update to Swift 4.

This commit is contained in:
Kare Morstol
2017-06-23 20:15:44 +02:00
parent 8518bcfbb0
commit eb9ded045b
6 changed files with 32 additions and 17 deletions
+1 -1
View File
@@ -1 +1 @@
3.1
4.0
+21 -1
View File
@@ -1,5 +1,25 @@
// swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "SwiftShell"
name: "SwiftShell",
products: [
.library(
name: "SwiftShell",
targets: ["SwiftShell"])
],
targets: [
.target(
name: "SwiftShell"),
.testTarget(
name: "SwiftShellTests",
dependencies: ["SwiftShell"]),
.testTarget(
name: "StreamTests",
dependencies: ["SwiftShell"]),
.testTarget(
name: "GeneralTests",
dependencies: ["SwiftShell"]),
],
swiftLanguageVersions: [4]
)
-2
View File
@@ -128,8 +128,6 @@ public func == (e1: CommandError, e2: CommandError) -> Bool {
return c1 == c2
case (.inAccessibleExecutable, .returnedErrorCode), (.returnedErrorCode, .inAccessibleExecutable):
return false
default:
fatalError("not implemented")
}
}
+4 -11
View File
@@ -19,12 +19,9 @@ extension Collection where Iterator.Element: Equatable {
/// A sequence from splitting a Collection lazily.
public struct LazySplitSequence <Base: Collection>: IteratorProtocol, LazySequenceProtocol where
Base.Iterator.Element: Equatable,
Base.SubSequence: Collection,
Base.SubSequence.Iterator.Element==Base.Iterator.Element,
Base.SubSequence==Base.SubSequence.SubSequence {
Base.SubSequence: Collection {
public fileprivate(set) var remaining: Base.SubSequence?
public let separator: Base.Generator.Element
public let separator: Base.Iterator.Element
public let allowEmptySlices: Bool
/// Creates a lazy sequence by splitting a Collection repeatedly.
@@ -50,9 +47,7 @@ public struct LazySplitSequence <Base: Collection>: IteratorProtocol, LazySequen
}
extension LazyCollectionProtocol where Elements.Iterator.Element: Equatable,
Elements.SubSequence: Collection,
Elements.SubSequence.Iterator.Element==Elements.Iterator.Element,
Elements.SubSequence==Elements.SubSequence.SubSequence {
Elements.SubSequence: Collection {
/// Creates a lazy sequence by splitting this Collection repeatedly.
///
@@ -71,9 +66,7 @@ extension LazyCollectionProtocol where Elements.Iterator.Element: Equatable,
/// A sequence from splitting a series of Collections lazily, as if they were one Collection.
public struct PartialSourceLazySplitSequence <Base: Collection>: IteratorProtocol, LazySequenceProtocol where
Base.Iterator.Element: Equatable,
Base.SubSequence: RangeReplaceableCollection,
Base.SubSequence.Iterator.Element==Base.Iterator.Element,
Base.SubSequence==Base.SubSequence.SubSequence {
Base.SubSequence: RangeReplaceableCollection {
private var gs: LazyMapIterator<AnyIterator<Base>, LazySplitSequence<Base>>
private var g: LazySplitSequence<Base>?
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -40,6 +40,7 @@
buildConfiguration = "Debug-iOS"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -69,6 +70,7 @@
buildConfiguration = "Debug-iOS"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -54,6 +54,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
@@ -104,6 +105,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"