mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
14 lines
283 B
Swift
14 lines
283 B
Swift
// RUN: %target-swift-frontend -typecheck -verify %S/Inputs/keypath.swift -primary-file %s
|
|
|
|
struct S {
|
|
let i: Int
|
|
|
|
init() {
|
|
let _: WritableKeyPath<S, Int> = \.i // no error for Swift 3/4
|
|
}
|
|
}
|
|
|
|
func test() {
|
|
let _: WritableKeyPath<C, Int> = \.i // no error for Swift 3/4
|
|
}
|