Skip to content

Commit 5ab5ee1

Browse files
committed
Only use duplicate typealias in Swift versions lower than 3.1
Fixes #39.
1 parent b4221fe commit 5ab5ee1

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

Sources/ExtendedDiff.swift

+4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
*/
1010
public struct ExtendedDiff: DiffProtocol {
1111

12+
#if swift(>=3.1)
13+
// The duplicate typealias is not required in Swift 3.1
14+
#else
1215
public typealias Index = Int
16+
#endif
1317

1418
public enum Element {
1519
case insert(at: Int)

Sources/NestedDiff.swift

+4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11

22
public struct NestedDiff: DiffProtocol {
33

4+
#if swift(>=3.1)
5+
// The duplicate typealias is not required in Swift 3.1
6+
#else
47
public typealias Index = Int
8+
#endif
59

610
public enum Element {
711
case deleteSection(Int)

Sources/NestedExtendedDiff.swift

+4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11

22
public struct NestedExtendedDiff: DiffProtocol {
33

4+
#if swift(>=3.1)
5+
// The duplicate typealias is not required in Swift 3.1
6+
#else
47
public typealias Index = Int
8+
#endif
59

610
public enum Element {
711
case deleteSection(Int)

0 commit comments

Comments
 (0)