mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
While trying to diagnose problems related to keypath components don't assume that type of the component is always correct, check before trying to see if it's bridged type or has members. Resolves: rdar://problem/33135487
9 lines
231 B
Swift
9 lines
231 B
Swift
// RUN: not %target-swift-frontend %s -typecheck
|
|
|
|
enum State<StateType> {
|
|
func put<StateType>() -> StateType {}
|
|
func put<T>(keyPath: WritableKeyPath<StateType, T>, projection: T) {
|
|
put(keyPath: \.age, projection: {})
|
|
}
|
|
}
|