Skip to content

Commit

Permalink
Update to Swift 5 (#121)
Browse files Browse the repository at this point in the history
* Fix some errors

* Update Travis

* Update Structure and Math versions
  • Loading branch information
jsbean committed Jun 12, 2019
1 parent 37779ce commit 162a47f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ os:
language: generic
sudo: required
dist: trusty
osx_image: xcode10
osx_image: xcode10.2
install:
- eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
env:
- SWIFT_VERSION=4.2
- SWIFT_VERSION=5.0
script:
- swift package update
- swift test
Expand Down
12 changes: 6 additions & 6 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"package": "Math",
"repositoryURL": "https://github.com/dn-m/Math",
"state": {
"branch": null,
"revision": "075ebb5a934251ed7acbe4feace925ed7e322d0f",
"version": "0.6.0"
"branch": "swift-5",
"revision": "51f8032aa2aea3e8a88b44dcc858c4551b855478",
"version": null
}
},
{
Expand All @@ -23,9 +23,9 @@
"package": "Structure",
"repositoryURL": "https://github.com/dn-m/Structure",
"state": {
"branch": null,
"revision": "11e920b1b883fe169c5ebb58e6489c0f28e9ad90",
"version": "0.20.0"
"branch": "swift-5",
"revision": "8f67514cba950f60ee992a8d0996d4f11d9654b0",
"version": null
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ let package = Package(
.library(name: "MusicModel", targets: ["MusicModel"])
],
dependencies: [
.package(url: "https://github.com/dn-m/Structure", from: "0.19.0"),
.package(url: "https://github.com/dn-m/Math", from: "0.6.0")
.package(url: "https://github.com/dn-m/Structure", from: "0.23.0"),
.package(url: "https://github.com/dn-m/Math", from: "0.7.0")
],
targets: [

Expand Down
3 changes: 1 addition & 2 deletions Sources/Duration/Rhythm/ProportionTree.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public func * (duration: Int, durations: [Int]) -> ProportionTree {

/// Tree recording the change (in degree of power-of-two) needed to normalize a
/// `ProprtionTree`.
typealias DistanceTree = Tree<Int,Int>
public typealias DistanceTree = Tree<Int,Int>

extension Tree where Branch == Int, Leaf == Int {

Expand Down Expand Up @@ -178,7 +178,6 @@ extension Tree where Branch == Int, Leaf == Int {
default:
fatalError("Incompatible trees")
}
return propagatedUp
}

return propagatedDown(self, propagatedUp(self), inherited: nil)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Duration/Tempo/Tempo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public extension Tempo.Interpolation {

/// An ordered, contiguous collection of `Tempo.Interpolation.Fragments` indexed by their
/// fractional offset.
public typealias Collection = ContiguousSegmentCollection<Tempo.Interpolation>
typealias Collection = ContiguousSegmentCollection<Tempo.Interpolation>
}

/// A class which encapsulates the stateful incremental building process of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Math
public struct IntervalSearchTree <Metric: Comparable, Value> {

/// Underlying `AVLTree` augmented for interval searching purposes.
typealias Base = AVLTree<Metric,Node>
public typealias Base = AVLTree<Metric,Node>

public struct Node {

Expand Down
4 changes: 2 additions & 2 deletions Sources/Pitch/NoteNumberRepresentable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ extension NoteNumberRepresentable {
// MARK: - Hashable

/// - Returns: The hash value of a `NoteNumberRepresentable` type.
public var hashValue: Int {
return value.hashValue
public func hash(into hasher: inout Hasher) {
hasher.combine(value)
}
}

Expand Down

0 comments on commit 162a47f

Please sign in to comment.