Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to support building with Swift 4.2 #37

Merged
merged 3 commits into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: generic
sudo: required
dist: trusty
env:
- SWIFT_VERSION=4.0
- SWIFT_VERSION=4.2
install:
- eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
script:
Expand Down
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:4.0
// swift-tools-version:4.2

import PackageDescription

Expand All @@ -11,5 +11,6 @@ let package = Package(
targets: [
.target(name: "Spectre", dependencies: []),
.testTarget(name: "SpectreTests", dependencies: ["Spectre"]),
]
],
swiftLanguageVersions: [.v4, .v4_2]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v4 doesn't include 4.2?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this break support on 4.0 because it would have no idea about the .4_2 enumeration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v4 doesn't include 4.2?

If you don't add 4.2 explicitly SwiftPM will assume 4 only

Would this break support on 4.0 because it would have no idea about the .4_2 enumeration?

It depends on what you mean by 4.0 here. It will require the Swift 4.2 (or newer) compiler, but it can still compile with Swift 4.0 syntax. Alternatively I can create a new [email protected] file, and not touch this one, to support both simultaneously going forward.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with the new file instead

)
2 changes: 1 addition & 1 deletion Sources/Spectre/Expectation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct ExpectationFailure : FailureType {

open class Expectation<T> : ExpectationType {
public typealias ValueType = T
open let expression: () throws -> ValueType?
public let expression: () throws -> ValueType?

let file: String
let line: Int
Expand Down