mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
While trying to validate Objective-C 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/33044867
16 lines
271 B
Swift
16 lines
271 B
Swift
// RUN: not %target-swift-frontend %s -typecheck
|
|
|
|
public class A {
|
|
var property: UndeclaredType
|
|
var keyPath: Any {
|
|
return #keyPath(property.foo)
|
|
}
|
|
}
|
|
|
|
public class B {
|
|
var property: UndeclaredType
|
|
var keyPath: Any {
|
|
return [#keyPath(property.foo)]
|
|
}
|
|
}
|