mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Calling '@objc optional func' requires '?' or '!' after its name. When completing method calls for them, 'key.sourcetext' should have '?' whereas 'key.name' shouldn't. Note that we deliberately do not use optional type name for 'key.typename'. This is consistent with optional chain '?.<propertyName>' behavior. rdar://problem/37904574
12 lines
259 B
Swift
12 lines
259 B
Swift
@objc protocol Proto {
|
|
@objc optional func optionalMethod() -> Int
|
|
}
|
|
|
|
func test<T : Proto>(obj: T) {
|
|
let _ = obj.
|
|
}
|
|
|
|
// RUN: %sourcekitd-test -req=complete -pos=6:15 %s -- %s > %t.response
|
|
// RUN: diff -u %s.response %t.response
|
|
// REQUIRES: objc_interop
|