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

Xcode 10 support #644

Merged
merged 7 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from 5 commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# master

1. Support Swift 4.2 (Xcode 10) (#644, kudos to @ikesyo)

# 4.0.0-rc.1*Please add new entries at the top.*

Expand Down
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "jspahrsummers/xcconfigs" == 0.12
github "Quick/Quick" ~> 1.2
github "Quick/Nimble" ~> 7.0.3
github "Quick/Nimble" ~> 7.1.2
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "Quick/Nimble" "v7.1.1"
github "Quick/Nimble" "v7.1.2"
github "Quick/Quick" "v1.3.0"
github "antitypical/Result" "4.0.0"
github "jspahrsummers/xcconfigs" "0.12"
8 changes: 4 additions & 4 deletions ReactiveSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,9 @@
isa = PBXNativeTarget;
buildConfigurationList = 57A4D23C1BA13D7A00F7D4B1 /* Build configuration list for PBXNativeTarget "ReactiveSwift-tvOS" */;
buildPhases = (
57A4D2091BA13D7A00F7D4B1 /* Headers */,
57A4D1B01BA13D7A00F7D4B1 /* Sources */,
57A4D2071BA13D7A00F7D4B1 /* Frameworks */,
57A4D2091BA13D7A00F7D4B1 /* Headers */,
57A4D23B1BA13D7A00F7D4B1 /* Resources */,
);
buildRules = (
Expand Down Expand Up @@ -673,9 +673,9 @@
isa = PBXNativeTarget;
buildConfigurationList = A9B3155D1B3940610001CB9C /* Build configuration list for PBXNativeTarget "ReactiveSwift-watchOS" */;
buildPhases = (
A9B315511B3940610001CB9C /* Headers */,
A9B3154F1B3940610001CB9C /* Sources */,
A9B315501B3940610001CB9C /* Frameworks */,
A9B315511B3940610001CB9C /* Headers */,
A9B315521B3940610001CB9C /* Resources */,
);
buildRules = (
Expand All @@ -691,9 +691,9 @@
isa = PBXNativeTarget;
buildConfigurationList = D047260019E49ED7006002AA /* Build configuration list for PBXNativeTarget "ReactiveSwift-macOS" */;
buildPhases = (
D04725E719E49ED7006002AA /* Headers */,
D04725E519E49ED7006002AA /* Sources */,
D04725E619E49ED7006002AA /* Frameworks */,
D04725E719E49ED7006002AA /* Headers */,
D04725E819E49ED7006002AA /* Resources */,
);
buildRules = (
Expand Down Expand Up @@ -727,9 +727,9 @@
isa = PBXNativeTarget;
buildConfigurationList = D047261F19E49F82006002AA /* Build configuration list for PBXNativeTarget "ReactiveSwift-iOS" */;
buildPhases = (
D047260919E49F82006002AA /* Headers */,
D047260719E49F82006002AA /* Sources */,
D047260819E49F82006002AA /* Frameworks */,
D047260919E49F82006002AA /* Headers */,
D047260A19E49F82006002AA /* Resources */,
);
buildRules = (
Expand Down
20 changes: 0 additions & 20 deletions Sources/ValidatingProperty.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,26 +178,6 @@ public final class ValidatingProperty<Value, ValidationError: Swift.Error>: Muta
self.init(MutableProperty(initial), with: other, validator)
}

/// Create a `ValidatingProperty` that presents a mutable validating
/// view for an inner mutable property.
///
/// The proposed value is only committed when `valid` is returned by the
/// `validator` closure.
///
/// - note: `inner` is retained by the created property.
///
/// - parameters:
/// - inner: The inner property which validated values are committed to.
/// - other: The property that `validator` depends on.
/// - validator: The closure to invoke for any proposed value to `self`.
public convenience init<U, E>(
Copy link
Member Author

Choose a reason for hiding this comment

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

The capture of the compiler error

2018-06-06 14 35 28

Copy link
Member Author

Choose a reason for hiding this comment

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

The following overload will be used instead after this removal:

public convenience init<Other: PropertyProtocol>(
_ inner: MutableProperty<Value>,
with other: Other,
_ validator: @escaping (Value, Other.Value) -> Decision
) {

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this makes sense 👍

Copy link
Member

@andersio andersio Jun 10, 2018

Choose a reason for hiding this comment

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

This changes the semantic. This overload was supposed to be the primary one, and the removed one here should have been implemented in terms of that.

Edit: Dropping down to PropertyProtocol leads to only successfully validated values from other being considered, while the intended semantic is to propagate any proposed value (regardless of its validation outcome) so that live validations are always reacting to any user interaction made.

Copy link
Member Author

@ikesyo ikesyo Jun 11, 2018

Choose a reason for hiding this comment

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

So what should be done here to avoid the compilation error instead of the removal? @andersio

Copy link
Member Author

@ikesyo ikesyo Jun 11, 2018

Choose a reason for hiding this comment

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

Feel free pushing your changes on this branch.

_ inner: MutableProperty<Value>,
with other: ValidatingProperty<U, E>,
_ validator: @escaping (Value, U) -> Decision
) {
self.init(inner, with: other, validator)
}

/// Create a `ValidatingProperty` that validates mutations before
/// committing them.
///
Expand Down
4 changes: 2 additions & 2 deletions Tests/ReactiveSwiftTests/SignalProducerSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2791,7 +2791,7 @@ class SignalProducerSpec: QuickSpec {
let producer = SignalProducer<Int, NoError>.never
.on(disposed: { disposed = true })

var replayedProducer = ImplicitlyUnwrappedOptional(producer.replayLazily(upTo: 1))
var replayedProducer = Optional(producer.replayLazily(upTo: 1))
Copy link
Contributor

Choose a reason for hiding this comment

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

So we were using it as a regular optional anyway? Huh.


expect(disposed) == false
let disposable1 = replayedProducer?.start()
Expand All @@ -2814,7 +2814,7 @@ class SignalProducerSpec: QuickSpec {
let producer = SignalProducer<Int, NoError>.never
.on(disposed: { disposed = true })

var replayedProducer = ImplicitlyUnwrappedOptional(producer.replayLazily(upTo: 1))
var replayedProducer = Optional(producer.replayLazily(upTo: 1))

expect(disposed) == false
let disposable = replayedProducer?.start()
Expand Down