Skip to content

Disable property wrapper composition. #26287

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

Merged

Conversation

jckarter
Copy link
Contributor

There are ABI-affecting bugs with composition like SR-11138, so disable until those bugs can be
fixed. rdar://problem/53428736

There are ABI-affecting bugs with composition like SR-11138, so disable until those bugs can be
fixed. rdar://problem/53428736
@jckarter jckarter requested a review from jrose-apple July 23, 2019 02:54
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter
Copy link
Contributor Author

@swift-ci Please test source compatibility

if (result.size() > 1) {
ctx.Diags.diagnose(result[result.size() - 2]->getLocation(),
diag::property_wrapper_composition_not_implemented);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: If you do this after the std::reverse below, you can avoid the weird "second-to-last" computation above, which confused me until I read the comment below.

@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter jckarter merged commit 03dcccb into swiftlang:master Jul 23, 2019
rxwei added a commit to rxwei/swift that referenced this pull request Aug 27, 2019
* Add derived conformances for the `EuclideanDifferentiable` protocol introduced in swiftlang#26287 when a conforming type satisfies `Differentiable` conformance synthesis requirements.

    ```swift
    struct Foo<T>: EuclideanDifferentiable where T.TangentVector == T {
      var x: T
      var y: T
      @noDerivative var z: Bool
      // The compiler synthesizes the following `EuclideanDifferentiable` requirement:
      //   var vectorView: TangentVector {
      //     return TangentVector(x: x, y: y)
      //   }
    }
    ```

* Remove `vectorView`'s setter. This should not have been added to the protocol, for the same reason as [TF-208](https://bugs.swift.org/browse/TF-208). A projection (`vectorView`) of a subset of properties should reflect these properties joint mutability, which is impossible to express at the moment.

Resolves [TF-777](https://bugs.swift.org/browse/TF-777).
dan-zheng pushed a commit that referenced this pull request Aug 27, 2019
#26867)

Add derived conformances for the `EuclideanDifferentiable` protocol introduced
in #26287 when a conforming type satisfies `Differentiable`
conformance synthesis requirements.

```swift
struct Foo<T>: EuclideanDifferentiable where T.TangentVector == T {
  var x: T
  var y: T
  @noDerivative var z: Bool
  // The compiler synthesizes the following `EuclideanDifferentiable` requirement:
  //   var vectorView: TangentVector {
  //     return TangentVector(x: x, y: y)
  //   }
}
```

Remove `vectorView`'s setter. This should not have been added to the protocol,
for the same reason as [TF-208](https://bugs.swift.org/browse/TF-208). A
projection (`vectorView`) of a subset of properties should reflect these
properties joint mutability, which is impossible to express at the moment.

Resolves [TF-777](https://bugs.swift.org/browse/TF-777).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants