RandomKit
RandomKit copied to clipboard
use Swift 4
My environment
macOS High Sierra 10.13.4 Xcode9.3
Problem
I just cloned master and got compile error below.
/Users/omochi/github/omochi/RandomKit/Sources/RandomKit/Extensions/Swift/Collection+RandomKit.swift:100:17: Invalid redeclaration of 'uncheckedRandom(in:using:)'
/Users/omochi/github/omochi/RandomKit/Sources/RandomKit/Extensions/Swift/Collection+RandomKit.swift:75:17: 'uncheckedRandom(in:using:)' previously declared here
/Users/omochi/github/omochi/RandomKit/Sources/RandomKit/Extensions/Swift/Collection+RandomKit.swift:106:73: Type 'Collection.IndexDistance' (aka 'Int') in conformance requirement does not refer to a generic parameter or associated type
The lines with error is in macro section for Swift less than 4.1. And a xcodeproj set swift version to 3.
Solution
This PR changes Swift version from 3 to 4 and avoid this error.