Skip to content

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Apr 22, 2019

Referencing (instance or static) methods in the key path is not
currently allowed, solver should be responsible for early detection
and diagnosis of both standalone e.g. \.foo and chained
e.g. \.foo.bar (where foo is a method) references in key path
components.

struct S {
  func foo() -> Int { return 42 }
}

let _: KeyPath<S, Int> = \.foo

Resolves: rdar://problem/49413561

xedin added 2 commits April 22, 2019 14:56
Referencing (instance or static) methods in the key path is not
currently allowed, solver should be responsible for early detection
and diagnosis of both standalone e.g. `\.foo` and chained
e.g. `\.foo.bar` (where foo is a method) references in key path
components.

```swift
struct S {
  func foo() -> Int { return 42 }
}

let _: KeyPath<S, Int> = \.foo
```

Resolves: rdar://problem/49413561
@xedin
Copy link
Contributor Author

xedin commented Apr 22, 2019

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Apr 22, 2019

@swift-ci please test source compatibility

1 similar comment
@xedin
Copy link
Contributor Author

xedin commented Apr 23, 2019

@swift-ci please test source compatibility

@xedin xedin merged commit afc9e20 into swiftlang:master Apr 23, 2019
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.

1 participant