You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When checking protocol conformances with `@differentiable` requirements, the type checker is supposed to accept omissions of `@differentiable` attributes when there exsits an attribute that covers a superset of the differentiation configuration. This was accidentally regressed in swiftlang#33776 which made the following test case fail to compile. This is fixed by adjusting the witness matching conditions.
```swift
// rdar://70348904 reproducer:
public protocol P: Differentiable {
@differentiable(wrt: self)
@differentiable(wrt: (self, x))
func foo(_ x: Float) -> Float
}
public struct S: P {}
extension S {
// This had worked until swiftlang#33776.
@differentiable(wrt: (self, x))
public func foo(_ x: Float) -> Float { x }
}
```
Also fix some suboptimal diagnostics where more information could be shown.
Resolves rdar://70348904.
0 commit comments