Skip to content

Commit 8c956a6

Browse files
authored
Merge pull request #271 from ankurp/swift-5
Fixing warning for Swift 5
2 parents 4feadc1 + c33c111 commit 8c956a6

File tree

9 files changed

+34
-36
lines changed

9 files changed

+34
-36
lines changed

.swift-sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"type": "sandbox",
33
"title": "Dollar",
44
"description": "Learn to use Dollar",
5-
"swiftversion": "swift-4.0-RELEASE-ubuntu14.04",
5+
"swiftversion": "swift-5.0-RELEASE-ubuntu14.04",
66
"giturl": "https://github.com/ankurp/DollarSwiftPackageSample",
77
"gittag": "1.0.0"
88
}

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2
1+
5.0

Dollar.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Dollar"
3-
s.version = "8.0.0"
3+
s.version = "9.0.0"
44
s.summary = "A functional tool-belt for Swift Language"
55
s.homepage = "https://github.com/ankurp/Dollar"
66
s.license = { :type => "MIT", :file => "LICENSE" }
@@ -12,5 +12,5 @@ Pod::Spec.new do |s|
1212
s.tvos.deployment_target = "9.0"
1313
s.watchos.deployment_target = "2.0"
1414
s.requires_arc = true
15-
s.swift_version = '4.2'
15+
s.swift_version = '5.0'
1616
end

Dollar.xcodeproj/project.pbxproj

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@
174174
LastUpgradeCheck = 9999;
175175
TargetAttributes = {
176176
"______Target_Dollar" = {
177-
LastSwiftMigration = 0900;
177+
LastSwiftMigration = 1030;
178178
};
179179
"______Target_DollarTests" = {
180-
LastSwiftMigration = 0900;
180+
LastSwiftMigration = 1030;
181181
};
182182
};
183183
};
@@ -186,6 +186,7 @@
186186
developmentRegion = English;
187187
hasScannedForEncodings = 0;
188188
knownRegions = (
189+
English,
189190
en,
190191
);
191192
mainGroup = "___RootGroup_";
@@ -243,8 +244,7 @@
243244
PRODUCT_BUNDLE_IDENTIFIER = Dollar;
244245
PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
245246
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
246-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
247-
SWIFT_VERSION = 4.0;
247+
SWIFT_VERSION = 5.0;
248248
};
249249
name = Release;
250250
};
@@ -257,8 +257,7 @@
257257
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
258258
OTHER_LDFLAGS = "$(inherited)";
259259
OTHER_SWIFT_FLAGS = "$(inherited)";
260-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
261-
SWIFT_VERSION = 4.0;
260+
SWIFT_VERSION = 5.0;
262261
};
263262
name = Release;
264263
};
@@ -276,8 +275,7 @@
276275
PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
277276
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
278277
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
279-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
280-
SWIFT_VERSION = 4.0;
278+
SWIFT_VERSION = 5.0;
281279
};
282280
name = Debug;
283281
};
@@ -291,8 +289,7 @@
291289
OTHER_LDFLAGS = "$(inherited)";
292290
OTHER_SWIFT_FLAGS = "$(inherited)";
293291
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
294-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
295-
SWIFT_VERSION = 4.0;
292+
SWIFT_VERSION = 5.0;
296293
};
297294
name = Debug;
298295
};

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Still stuck. Then checkout this screencast on [how to import](http://recordit.co
4444

4545
## Support for Xcode and Swift
4646

47+
* For Xcode 11 (Swift 5.0) use version `9.0.0`
4748
* For Xcode 10 (Swift 4.2) use version `8.0.0`
4849
* For Xcode 9 (Swift 4) use version `7.1.0`
4950
* For Xcode 8 (Swift 3) use version `6.0.0`

Sources/AutoBind.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,52 @@
22

33
public extension Dollar {
44

5-
public class func bind<T1, R>(f: @escaping (T1) -> R, _ t1: T1) -> (() -> R) {
5+
class func bind<T1, R>(f: @escaping (T1) -> R, _ t1: T1) -> (() -> R) {
66
return { f(t1) }
77
}
88

99

10-
public class func bind<T1, T2, R>(f: @escaping (T1, T2) -> R, _ t1: T1, _ t2: T2) -> (() -> R) {
10+
class func bind<T1, T2, R>(f: @escaping (T1, T2) -> R, _ t1: T1, _ t2: T2) -> (() -> R) {
1111
return { f(t1, t2) }
1212
}
1313

1414

15-
public class func bind<T1, T2, T3, R>(f: @escaping (T1, T2, T3) -> R, _ t1: T1, _ t2: T2, _ t3: T3) -> (() -> R) {
15+
class func bind<T1, T2, T3, R>(f: @escaping (T1, T2, T3) -> R, _ t1: T1, _ t2: T2, _ t3: T3) -> (() -> R) {
1616
return { f(t1, t2, t3) }
1717
}
1818

1919

20-
public class func bind<T1, T2, T3, T4, R>(f: @escaping (T1, T2, T3, T4) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4) -> (() -> R) {
20+
class func bind<T1, T2, T3, T4, R>(f: @escaping (T1, T2, T3, T4) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4) -> (() -> R) {
2121
return { f(t1, t2, t3, t4) }
2222
}
2323

2424

25-
public class func bind<T1, T2, T3, T4, T5, R>(f: @escaping (T1, T2, T3, T4, T5) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4, _ t5: T5) -> (() -> R) {
25+
class func bind<T1, T2, T3, T4, T5, R>(f: @escaping (T1, T2, T3, T4, T5) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4, _ t5: T5) -> (() -> R) {
2626
return { f(t1, t2, t3, t4, t5) }
2727
}
2828

2929

30-
public class func bind<T1, T2, T3, T4, T5, T6, R>(f: @escaping (T1, T2, T3, T4, T5, T6) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4, _ t5: T5, _ t6: T6) -> (() -> R) {
30+
class func bind<T1, T2, T3, T4, T5, T6, R>(f: @escaping (T1, T2, T3, T4, T5, T6) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4, _ t5: T5, _ t6: T6) -> (() -> R) {
3131
return { f(t1, t2, t3, t4, t5, t6) }
3232
}
3333

3434

35-
public class func bind<T1, T2, T3, T4, T5, T6, T7, R>(f: @escaping (T1, T2, T3, T4, T5, T6, T7) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4, _ t5: T5, _ t6: T6, _ t7: T7) -> (() -> R) {
35+
class func bind<T1, T2, T3, T4, T5, T6, T7, R>(f: @escaping (T1, T2, T3, T4, T5, T6, T7) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4, _ t5: T5, _ t6: T6, _ t7: T7) -> (() -> R) {
3636
return { f(t1, t2, t3, t4, t5, t6, t7) }
3737
}
3838

3939

40-
public class func bind<T1, T2, T3, T4, T5, T6, T7, T8, R>(f: @escaping (T1, T2, T3, T4, T5, T6, T7, T8) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4, _ t5: T5, _ t6: T6, _ t7: T7, _ t8: T8) -> (() -> R) {
40+
class func bind<T1, T2, T3, T4, T5, T6, T7, T8, R>(f: @escaping (T1, T2, T3, T4, T5, T6, T7, T8) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4, _ t5: T5, _ t6: T6, _ t7: T7, _ t8: T8) -> (() -> R) {
4141
return { f(t1, t2, t3, t4, t5, t6, t7, t8) }
4242
}
4343

4444

45-
public class func bind<T1, T2, T3, T4, T5, T6, T7, T8, T9, R>(f: @escaping (T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4, _ t5: T5, _ t6: T6, _ t7: T7, _ t8: T8, _ t9: T9) -> (() -> R) {
45+
class func bind<T1, T2, T3, T4, T5, T6, T7, T8, T9, R>(f: @escaping (T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4, _ t5: T5, _ t6: T6, _ t7: T7, _ t8: T8, _ t9: T9) -> (() -> R) {
4646
return { f(t1, t2, t3, t4, t5, t6, t7, t8, t9) }
4747
}
4848

4949

50-
public class func bind<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R>(f: @escaping (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4, _ t5: T5, _ t6: T6, _ t7: T7, _ t8: T8, _ t9: T9, _ t10: T10) -> (() -> R) {
50+
class func bind<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R>(f: @escaping (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R, _ t1: T1, _ t2: T2, _ t3: T3, _ t4: T4, _ t5: T5, _ t6: T6, _ t7: T7, _ t8: T8, _ t9: T9, _ t10: T10) -> (() -> R) {
5151
return { f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) }
5252
}
5353

Sources/AutoCurry.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,47 @@
22

33
public extension Dollar {
44

5-
public class func curry<T1, T2, R>(_ f: @escaping (T1, T2) -> R) -> (T1) -> (T2) -> R {
5+
class func curry<T1, T2, R>(_ f: @escaping (T1, T2) -> R) -> (T1) -> (T2) -> R {
66
return { t1 in { t2 in f(t1, t2) } }
77
}
88

99

10-
public class func curry<T1, T2, T3, R>(_ f: @escaping (T1, T2, T3) -> R) -> (T1) -> (T2) -> (T3) -> R {
10+
class func curry<T1, T2, T3, R>(_ f: @escaping (T1, T2, T3) -> R) -> (T1) -> (T2) -> (T3) -> R {
1111
return { t1 in { t2 in { t3 in f(t1, t2, t3) } } }
1212
}
1313

1414

15-
public class func curry<T1, T2, T3, T4, R>(_ f: @escaping (T1, T2, T3, T4) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> R {
15+
class func curry<T1, T2, T3, T4, R>(_ f: @escaping (T1, T2, T3, T4) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> R {
1616
return { t1 in { t2 in { t3 in { t4 in f(t1, t2, t3, t4) } } } }
1717
}
1818

1919

20-
public class func curry<T1, T2, T3, T4, T5, R>(_ f: @escaping (T1, T2, T3, T4, T5) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> (T5) -> R {
20+
class func curry<T1, T2, T3, T4, T5, R>(_ f: @escaping (T1, T2, T3, T4, T5) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> (T5) -> R {
2121
return { t1 in { t2 in { t3 in { t4 in { t5 in f(t1, t2, t3, t4, t5) } } } } }
2222
}
2323

2424

25-
public class func curry<T1, T2, T3, T4, T5, T6, R>(_ f: @escaping (T1, T2, T3, T4, T5, T6) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> (T5) -> (T6) -> R {
25+
class func curry<T1, T2, T3, T4, T5, T6, R>(_ f: @escaping (T1, T2, T3, T4, T5, T6) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> (T5) -> (T6) -> R {
2626
return { t1 in { t2 in { t3 in { t4 in { t5 in { t6 in f(t1, t2, t3, t4, t5, t6) } } } } } }
2727
}
2828

2929

30-
public class func curry<T1, T2, T3, T4, T5, T6, T7, R>(_ f: @escaping (T1, T2, T3, T4, T5, T6, T7) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> (T5) -> (T6) -> (T7) -> R {
30+
class func curry<T1, T2, T3, T4, T5, T6, T7, R>(_ f: @escaping (T1, T2, T3, T4, T5, T6, T7) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> (T5) -> (T6) -> (T7) -> R {
3131
return { t1 in { t2 in { t3 in { t4 in { t5 in { t6 in { t7 in f(t1, t2, t3, t4, t5, t6, t7) } } } } } } }
3232
}
3333

3434

35-
public class func curry<T1, T2, T3, T4, T5, T6, T7, T8, R>(_ f: @escaping (T1, T2, T3, T4, T5, T6, T7, T8) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> (T5) -> (T6) -> (T7) -> (T8) -> R {
35+
class func curry<T1, T2, T3, T4, T5, T6, T7, T8, R>(_ f: @escaping (T1, T2, T3, T4, T5, T6, T7, T8) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> (T5) -> (T6) -> (T7) -> (T8) -> R {
3636
return { t1 in { t2 in { t3 in { t4 in { t5 in { t6 in { t7 in { t8 in f(t1, t2, t3, t4, t5, t6, t7, t8) } } } } } } } }
3737
}
3838

3939

40-
public class func curry<T1, T2, T3, T4, T5, T6, T7, T8, T9, R>(_ f: @escaping (T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> (T5) -> (T6) -> (T7) -> (T8) -> (T9) -> R {
40+
class func curry<T1, T2, T3, T4, T5, T6, T7, T8, T9, R>(_ f: @escaping (T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> (T5) -> (T6) -> (T7) -> (T8) -> (T9) -> R {
4141
return { t1 in { t2 in { t3 in { t4 in { t5 in { t6 in { t7 in { t8 in { t9 in f(t1, t2, t3, t4, t5, t6, t7, t8, t9) } } } } } } } } }
4242
}
4343

4444

45-
public class func curry<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R>(_ f: @escaping (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> (T5) -> (T6) -> (T7) -> (T8) -> (T9) -> (T10) -> R {
45+
class func curry<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R>(_ f: @escaping (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R) -> (T1) -> (T2) -> (T3) -> (T4) -> (T5) -> (T6) -> (T7) -> (T8) -> (T9) -> (T10) -> R {
4646
return { t1 in { t2 in { t3 in { t4 in { t5 in { t6 in { t7 in { t8 in { t9 in { t10 in f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) } } } } } } } } } }
4747
}
4848

Sources/Dollar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ open class Dollar {
957957
/// the last partition may less than n elements long.
958958
/// - returns: Array partitioned into n element arrays, starting step elements apart.
959959
open class func partition<T>(_ array: [T], n num: Int, step: Int? = .none, pad: [T]?) -> [[T]] {
960-
var array = array
960+
let array = array
961961
var num = num
962962
var step = step
963963
var result: [[T]] = []

Tests/DollarTests/DollarTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class DollarTests: XCTestCase {
165165
}
166166

167167
func testSequence() {
168-
XCTAssertEqual(Dollar.sequence("abc".characters), ["a", "b", "c"], "Generates array of characters")
168+
XCTAssertEqual(Dollar.sequence("abc"), ["a", "b", "c"], "Generates array of characters")
169169
}
170170

171171
func testRemove() {
@@ -620,7 +620,7 @@ class DollarTests: XCTestCase {
620620
XCTAssertEqual(oddEven[0]!, [2, 4], "Returns dictionary grouped by remainders of two")
621621
XCTAssertEqual(oddEven[1]!, [1, 3], "Returns dictionary grouped by remainders of two")
622622

623-
let wordCount = Dollar.groupBy(["strings", "with", "different", "lengths"], callback: {$0.characters.count})
623+
let wordCount = Dollar.groupBy(["strings", "with", "different", "lengths"], callback: {$0.count})
624624
XCTAssertEqual(wordCount[7]!, ["strings", "lengths"], "Returns dictionary with string lengths as keys")
625625
XCTAssertEqual(wordCount[9]!, ["different"], "Returns dictionary with string lengths as keys")
626626
XCTAssertEqual(wordCount[4]!, ["with"], "Returns dictionary with string lengths as keys")

0 commit comments

Comments
 (0)